Browse Source

【接口看板+job+inventory】查看主表封装-暂存

master
安虹睿 11 months ago
parent
commit
3b66042572
  1. 24
      PC/InterFace.Dash/README.md
  2. 54
      PC/InterFace.Dash/src/components/commonTabel-drawer/index.vue
  3. 403
      PC/InterFace.Dash/src/components/filterForDetailPage/index.vue
  4. 184
      PC/InterFace.Dash/src/mixins/TableMixins.js
  5. 6
      PC/InterFace.Dash/src/mixins/mixins.js
  6. 34
      PC/InterFace.Dash/src/utils/baseData/urlOption.js
  7. 98
      PC/InterFace.Dash/src/utils/index.js
  8. 24
      PC/UI.WinIn.FasterZ.Inventory/README.md
  9. 54
      PC/UI.WinIn.FasterZ.Inventory/src/components/commonTabel-drawer/index.vue
  10. 403
      PC/UI.WinIn.FasterZ.Inventory/src/components/filterForDetailPage/index.vue
  11. 184
      PC/UI.WinIn.FasterZ.Inventory/src/mixins/TableMixins.js
  12. 6
      PC/UI.WinIn.FasterZ.Inventory/src/mixins/mixins.js
  13. 17
      PC/UI.WinIn.FasterZ.Inventory/src/utils/baseData/urlOption.js
  14. 230
      PC/UI.WinIn.FasterZ.Inventory/src/utils/index.js
  15. 24
      PC/UI.WinIn.FasterZ.Job/README.md
  16. 54
      PC/UI.WinIn.FasterZ.Job/src/components/commonTabel-drawer/index.vue
  17. 403
      PC/UI.WinIn.FasterZ.Job/src/components/filterForDetailPage/index.vue
  18. 184
      PC/UI.WinIn.FasterZ.Job/src/mixins/TableMixins.js
  19. 6
      PC/UI.WinIn.FasterZ.Job/src/mixins/mixins.js
  20. 56
      PC/UI.WinIn.FasterZ.Job/src/utils/baseData/urlOption.js
  21. 230
      PC/UI.WinIn.FasterZ.Job/src/utils/index.js

24
PC/InterFace.Dash/README.md

@ -124,3 +124,27 @@ pointNumberFixed 组合上方validType值仅等于pointNumber时:
小数点后方保留位数,如不填写默认为100位 小数点后方保留位数,如不填写默认为100位
<validType>+<pointNumberFixed>示例: <validType>+<pointNumberFixed>示例:
{ type:"input", label:"金额", prop:"money", validType:'pointNumber',pointNumberFixed:2}, { type:"input", label:"金额", prop:"money", validType:'pointNumber',pointNumberFixed:2},
[urlOpion示例]
// 添加页面需要配置位置
// 示例数据
export const TestSchool = {
baseURL:'TestSchool/base',//主表-列表
detailURL:'app/test-school',//主表-明细 + 明细-查看主表
// detailInfoName:'asnNbr',//主表-明细查看详情的title名称
detailListURL:'TestStudentDetail/base',//明细-列表,
masterId:'masterId',//明细获取主表信息的masterId,默认依次为[默认配置defalutMasterId,固定值masterId]
masterName:'studentName'//明细获取主表信息的title名称
// parentURL:null,//明细-查看主表:特殊接口,如果没有则走detailURL
// deleteURL:null,//删除特殊URL
// addURL:null,//新增特殊URL
// editURL:null,//编辑特殊URL
// exportURL:'exportURL',//导出特殊URL
<!-- 20231124 有主表的子列表 查看详情的主表信息处理 -->
//有主表的子表单页的主表信息接口,默认为当前的[detailURL]去掉[-Detail]
// mainShowMasterUrl:null,
//有主表的子表单页的主表链接参数,默认依次为[默认配置defalutMasterId,上方配置中masterId,固定值masterId]
// mainShowMasterId:'masterId',
//有主表的子表单页的主表路由[用于显示列转义],默认为[当前路由]去掉[Detail]
// masterRoute:null,
}

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

@ -49,6 +49,7 @@
@handleClick="handleClick" @handleClick="handleClick"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 详情 -->
<curren-descriptions <curren-descriptions
border border
v-if="scope.value == 'xq'" v-if="scope.value == 'xq'"
@ -59,6 +60,17 @@
:propsData="propsData" :propsData="propsData"
> >
</curren-descriptions> </curren-descriptions>
<!-- 主表信息 -->
<curren-descriptions
border
v-if="scope.value == 'masterInfo'"
:column="column"
:direction="direction"
:colon="false"
:tabsDesTions="masterColums"
:propsData="propsData.masterInfo"
>
</curren-descriptions>
<!-- 明细 包含分页 头部按钮等 --> <!-- 明细 包含分页 头部按钮等 -->
<tablePagination <tablePagination
ref="tablePaginationForMX_Ref" ref="tablePaginationForMX_Ref"
@ -104,11 +116,12 @@
</template> </template>
</umyTable> </umyTable>
<!-- 自定义扩展 --> <!-- 自定义扩展 -->
<umyTable <!-- <umyTable
v-if=" v-if="
scope.value == zdyValue && scope.value == zdyValue &&
scope.value != 'xq' && scope.value != 'xq' &&
scope.value != 'mx' && scope.value != 'mx' &&
scope.value != 'masterInfo' &&
scope.value != 'hz' && scope.value != 'hz' &&
scope.value != 'zwlcj' scope.value != 'zwlcj'
" "
@ -127,7 +140,7 @@
<template> <template>
<slot></slot> <slot></slot>
</template> </template>
</umyTable> </umyTable> -->
</template> </template>
</curren-tabs> </curren-tabs>
</div> </div>
@ -171,6 +184,10 @@ import pagination from "@/components/Pagination"
import rowDrop from "@/components/rowDrop/index.vue" import rowDrop from "@/components/rowDrop/index.vue"
import * as allUrlOption from '@/utils/baseData/urlOption' import * as allUrlOption from '@/utils/baseData/urlOption'
import { LoadingMixins } from "@/mixins/LoadingMixins"; import { LoadingMixins } from "@/mixins/LoadingMixins";
import {
initApiColumnsForDto,
sliceStrEndDelete
} from '@/utils/index'
export default { export default {
name: 'currenTabel-drawer', name: 'currenTabel-drawer',
components: { components: {
@ -309,7 +326,8 @@ export default {
// tabs // tabs
if (this.dropdownTabsData.length !== 0) { if (this.dropdownTabsData.length !== 0) {
return this.dropdownTabsData return this.dropdownTabsData
} else { }
else {
// //
// if (Object.keys(this.propsData).length != 0) { // if (Object.keys(this.propsData).length != 0) {
if (Object.keys(this.propsData)) { if (Object.keys(this.propsData)) {
@ -317,6 +335,14 @@ export default {
label: "详情", label: "详情",
name: 'xq' name: 'xq'
}] }]
if(this.propsData.masterInfo && this.propsData.masterInfo.length > 0){
this.initDropdownTabsData.push({
label: "主表信息",
name: 'masterInfo'
})
let _master_name = this.URLOption.masterRoute || sliceStrEndDelete(this.$route.name,'Detail')
this.masterColums = initApiColumnsForDto(this.propsData.masterInfo,_master_name,this)
}
// 使 // 使
if(this.propsData.details){ if(this.propsData.details){
this.initDropdownTabsData.push({ this.initDropdownTabsData.push({
@ -343,9 +369,9 @@ export default {
detailHeaderButton:null,//- detailHeaderButton:null,//-
detailInfoTableData:null,//- detailInfoTableData:null,//-
detailInfoTitle:null,//-title detailInfoTitle:null,//-title
otherData:[], // tabs // otherData:[], // tabs
zdyTableColumns:[], // // zdyTableColumns:[], //
zdyValue:'', // // zdyValue:'', //
// firstTabs:'xq', // firstTabs:'xq',
initDropdownTabsData:[ initDropdownTabsData:[
{ {
@ -375,10 +401,14 @@ export default {
MaxResultCount: 20, MaxResultCount: 20,
}, },
totalCountForDetail:0, totalCountForDetail:0,
//-id
URLOption:allUrlOption[this.$route.name],
//-id //-id
URLOption_masterId:allUrlOption[this.$route.name].masterId || 'masterId', URLOption_masterId:allUrlOption[this.$route.name].masterId || allUrlOption.defalutMasterId || 'masterId',
//- //-
URLOption_detailList:allUrlOption[this.$route.name].detailListURL, URLOption_detailList:allUrlOption[this.$route.name].detailListURL,
//
masterColums:null
} }
}, },
methods: { methods: {
@ -574,7 +604,7 @@ export default {
// tabs // tabs
handleClick (val) { handleClick (val) {
this.$emit("currenTabsChange", val);//tab this.$emit("currenTabsChange", val);//tab
this.zdyValue = val.name // this.zdyValue = val.name
this.dropdownTabsData.forEach( item => { this.dropdownTabsData.forEach( item => {
if (item.name == val.name) { if (item.name == val.name) {
let parent = this.$parent let parent = this.$parent
@ -582,12 +612,12 @@ export default {
// //
parent.firstTabs = val.name parent.firstTabs = val.name
if (val.name == 'xq' || val.name == 'mx' || val.name == 'hz') { if (val.name == 'xq' || val.name == 'mx' || val.name == 'hz') {
this.zdyTableColumns = [] // this.zdyTableColumns = []
this.otherData = [] // this.otherData = []
parent.tableLoading = false parent.tableLoading = false
} else { } else {
this.zdyTableColumns = [] // this.zdyTableColumns = []
this.otherData = [] // this.otherData = []
// this.firstTabs = val.name // this.firstTabs = val.name
// tab // tab
// if (item.functionName == 'getListByItemcode') { // if (item.functionName == 'getListByItemcode') {

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

@ -120,219 +120,216 @@
</el-table> --> </el-table> -->
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import currenDescriptions from "@/components/currenDescriptions" import currenDescriptions from "@/components/currenDescriptions"
import { tableMixins } from "@/mixins/TableMixins"; import { tableMixins } from "@/mixins/TableMixins";
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins"; import { TableHeaderMixins } from "@/mixins/TableHeaderMixins";
import { LoadingMixins } from "@/mixins/LoadingMixins"; import { LoadingMixins } from "@/mixins/LoadingMixins";
import { mixins } from "@/mixins/mixins"; import { mixins } from "@/mixins/mixins";
import { filterSelectMixins } from '@/mixins/filter-Select' import { filterSelectMixins } from '@/mixins/filter-Select'
import {getListDesById,getPageListForDetail} from "@/api/wms-api" import {getListDesById,getPageListForDetail} from "@/api/wms-api"
export default { import { initApiColumnsForDto } from '@/utils/index'
name: 'filterForDetailPage', export default {
mixins: [ name: 'filterForDetailPage',
tableMixins, mixins: [
TableHeaderMixins, tableMixins,
mixins, TableHeaderMixins,
filterSelectMixins, mixins,
LoadingMixins filterSelectMixins,
], LoadingMixins
components:{ ],
currenDescriptions components:{
}, currenDescriptions
props: { },
// app-main100% props: {
setUTableHeight: { // app-main100%
type: Number, setUTableHeight: {
default: 340
},
//
isShowIndex:{
type: Boolean,
default: false
},
//
tableSelection: {
type: Boolean,
default: false
},
cellStyle: {
type: Function,
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'
// showParentfreshfilterfield
return ['showParent','fresh','filter','field'];
}
},
// 2
column: {
type: Number, type: Number,
default: 2 default: 340
}, },
// //
direction: { isShowIndex:{
type: Boolean,
default: false
},
//
tableSelection: {
type: Boolean,
default: false
},
cellStyle: {
type: Function,
default: () => {
return Function;
}
},
//
showOverflowTooltip:{
type: Boolean,
default: false,
},
// api
DeleteApi: {
type: String, type: String,
default: 'horizontal' default: null
},
rowMaxHeight:{
type:String,
default:'calc(90vh - 450px)'
},
}, },
data () { // -
return { parentColumns:{
dialogShow:true, type: Array,
// URLOption_detailList:allUrlOption[this.$route.name].detailListURL,//- default: null
// URLOption_masterId:allUrlOption[this.$route.name].masterId || 'masterId',//-id },
// URLOption_masterName:allUrlOption[this.$route.name].masterName,//-//-title showHandleButtons:{
// URLOption_parent:allUrlOption[this.$route.name].parentURL ? allUrlOption[this.$route.name].parentURL : allUrlOption[this.$route.name].detailURL,//- type:Array,
currenButtonData: [],// default:() => {
operaButtons:[],// //'add','edit' 'delete'
showParentDialog:false,// // showParentfreshfilterfield
showParentTitle:null,//-title return ['showParent','fresh','filter','field'];
showParentTableData:null,//-
showParentLoading:false,//-
listColumns:[],//
} }
}, },
activated(){ // 2
// column: {
this.dialogShow = false type: Number,
this.$nextTick(() => { default: 2
this.dialogShow = true },
}); //
direction: {
type: String,
default: 'horizontal'
}, },
mounted(){ rowMaxHeight:{
this.paging() type:String,
this.initHandleButtons() default:'calc(90vh - 450px)'
}, },
methods: { },
rowDropForDetail(data,type){ data () {
this.listColumns = data return {
this.$emit("rowDropForDetail", data,type) dialogShow:true,
}, currenButtonData: [],//
// operaButtons:[],//
initHandleButtons(){ showParentDialog:false,//
// showParentTitle:null,//-title
let _arr_header = [] showParentTableData:null,//-
if(this.showHandleButtons.indexOf('add') >= 0){_arr_header.push(this.defaultAddBtn())} showParentLoading:false,//-
if(this.showHandleButtons.indexOf('field') >= 0){_arr_header.push(this.defaultFieldSettingBtn())} listColumns:[],//
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 activated(){
//
this.dialogShow = false
this.$nextTick(() => {
this.dialogShow = true
});
},
mounted(){
this.paging()
this.initHandleButtons()
},
methods: {
rowDropForDetail(data,type){
this.listColumns = data
this.$emit("rowDropForDetail", data,type)
},
//
initHandleButtons(){
//
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 = initApiColumnsForDto(res.items[0],_parentName,this)
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.$message.error("数据获取失败") this.tableData = []
}) res.items.forEach(item=>{
}, item.deleteTipVisible = false
// this.tableData.push(item)
showParentHandleForDetail(data){ })
this.showParentTitle = `${data[this.URLOption_masterName] || ''} 主表信息` this.totalCount = res.totalCount
this.showParentDialog = true }
this.showParentLoading = true this.pagingCallback(callback)
getListDesById(this.URLOption_parent,data[this.URLOption_masterId]) })
.then(res => { .catch(err=>{
this.showParentTableData = res this.Loading.tableLoading = false
this.showParentLoading = false this.$message.error("数据获取失败")
}) })
.catch(err => { },
this.showParentLoading = false //
this.$message.error("主表信息获取失败!") showParentHandleForDetail(data){
}) this.showParentTitle = `${data[this.URLOption_masterName] || ''} 主表信息`
}, this.showParentDialog = true
// this.showParentLoading = true
editHandleForDetail(data){ getListDesById(this.URLOption_parent,data[this.URLOption_masterId])
console.log(data) .then(res => {
}, this.showParentTableData = res
// this.showParentLoading = false
deleteHandleForDetail(data){ })
this.Loading.appMainLoading = true .catch(err => {
data.deleteTipVisible = false this.showParentLoading = false
// interfaceApi[this.DeleteApi](data.id).then(res => { this.$message.error("主表信息获取失败!")
// this.$successMsg('!') })
// this.oldSkipCount = 1 },
// this.Loading.appMainLoading = false //
// this.paging() editHandleForDetail(data){
// }).catch(err => { console.log(data)
// this.Loading.appMainLoading = false },
// this.$message.error("!") //
// }) 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> }
<style lang="scss"> </script>
.filterForDetailPage { <style lang="scss">
.filterForDetailPage {
.mainTable-dialog{ .mainTable-dialog{
.el-dialog{ .el-dialog{
height: calc(100% - 100px); height: calc(100% - 100px);
}
}
.el-dialog__body{
min-height: 200px;
padding-bottom: 20px !important;
} }
}
.filterForDetailPage-list{
height: calc(100%);
overflow: auto;
} }
</style> .el-dialog__body{
min-height: 200px;
padding-bottom: 20px !important;
}
}
.filterForDetailPage-list{
height: calc(100%);
overflow: auto;
}
</style>

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

@ -1,11 +1,13 @@
import i18n from "@/lang"
import { import {
getPageList, getPageList,
getDetailed, getDetailed,
postDelete, postDelete,
ApiTypeDelete ApiTypeDelete
} from '@/api/wms-api' } from '@/api/wms-api'
import { zhApiColumnsLable,firstWordSizeChange } from '@/utils/index' import {
initApiColumnsForDto,
sliceStrEndDelete
} from '@/utils/index'
export const tableMixins = { export const tableMixins = {
data() { data() {
return { return {
@ -103,9 +105,22 @@ export const tableMixins = {
} }
// 编辑 api // 编辑 api
else if (item.name == "editFromApi") { else if (item.name == "editFromApi") {
this.addEditApiType = 'edit' // this.addEditApiType = 'edit'
this.editFromApiRowData = row // this.editFromApiRowData = row
this.displayDialog.addEditApiDialog = true; // this.displayDialog.addEditApiDialog = true;
let _url = this.URLOption_detail ? this.URLOption_detail : this.URLOption_base
this.Loading.tableLoading = true
getDetailed(row.id, _url)
.then(res=>{
this.addEditApiType = 'edit'
this.editFromApiRowData = res
this.displayDialog.addEditApiDialog = true;
this.Loading.tableLoading = false
})
.catch(err=>{
this.Loading.tableLoading = false
})
} }
// 删除 // 删除
else if (item.name == "delete"){ else if (item.name == "delete"){
@ -158,95 +173,6 @@ export const tableMixins = {
// if(detailsTable && detailsTable[this.$route.name])this.apiColumns_DetailsTable = this.initTableColumns(detailsTable[this.$route.name],'detail_api') // if(detailsTable && detailsTable[this.$route.name])this.apiColumns_DetailsTable = this.initTableColumns(detailsTable[this.$route.name],'detail_api')
// if(detailsPage && detailsPage[this.$route.name])this.apiColumns_DetailsPage = this.initTableColumns(detailsPage[this.$route.name],'detailPage_api') // if(detailsPage && detailsPage[this.$route.name])this.apiColumns_DetailsPage = this.initTableColumns(detailsPage[this.$route.name],'detailPage_api')
// }, // },
// get-dto-column-type接口表头类型初始化
initApiColumnsForDto(list,titleName){
let data = this.$store.getters.dtoColumnTypes
let _coloums = data[titleName].S
let _Columns_Table = []
if(_coloums){
let _data = _coloums.dtoList
_data.forEach(item=>{
// 如果list接口存在数据 ,与list接口返回字段比较处理,list接口存在的话则追加
let _if = firstWordSizeChange(item.name) != 'details'
if(list){
_if = firstWordSizeChange(item.name) in list && firstWordSizeChange(item.name) != 'details'
}
if(_if){
_Columns_Table.push(item)
}
})
}
if(list){
_Columns_Table = _Columns_Table.concat(this.specialAddColumns(list,titleName))
}
return _Columns_Table
},
// 添加特殊字段(api中没有的字段特殊处理)
specialAddColumns(list,titleName){
let _apiName = titleName
let _special_list=[]
// creationTime
if('creationTime' in list){
_special_list.push(
{
"name": "CreationTime",
"apiBaseType": "datetime",
"baseApiName": _apiName + 'CreationTime',
"label": zhApiColumnsLable(_apiName + 'CreationTime') || i18n.t('columNames.CreationTime'),
"prop": "creationTime",
}
)
}
// creatorId
if('creatorId' in list){
_special_list.push(
{
"name": "CreatorId",
"apiBaseType": "string",
"baseApiName": _apiName + 'CreatorId',
"label": zhApiColumnsLable(_apiName + 'CreatorId') || i18n.t('columNames.CreatorId'),
"prop": "creatorId",
}
)
}
// lastModificationTime
if('lastModificationTime' in list){
_special_list.push(
{
"name": "LastModificationTime",
"apiBaseType": "datetime",
"baseApiName": _apiName + 'LastModificationTime',
"label": zhApiColumnsLable(_apiName + 'LastModificationTime') || i18n.t('columNames.LastModificationTime'),
"prop": "lastModificationTime",
}
)
}
// lastModifierId
if('lastModifierId' in list){
_special_list.push(
{
"name": "LastModifierId",
"apiBaseType": "string",
"baseApiName": _apiName + 'LastModifierId',
"label": zhApiColumnsLable(_apiName + 'LastModifierId') || i18n.t('columNames.LastModifierId'),
"prop": "lastModifierId",
}
)
}
// tenantId
if('tenantId' in list){
_special_list.push(
{
"name": "TenantId",
"apiBaseType": "string",
"baseApiName": _apiName + 'TenantId',
"label": zhApiColumnsLable(_apiName + 'TenantId') || i18n.t('columNames.TenantId'),
"prop": "tenantId",
}
)
}
return _special_list
},
//渲染数据 //渲染数据
paging(callback,repeat) { paging(callback,repeat) {
this.Loading.tableLoading = true; this.Loading.tableLoading = true;
@ -255,7 +181,7 @@ export const tableMixins = {
.then(res=>{ .then(res=>{
// 表头处理 // 表头处理
let _list = res.items && res.items.length > 0 ? res.items[0] : null let _list = res.items && res.items.length > 0 ? res.items[0] : null
let _Columns = this.initApiColumnsForDto(_list,this.$route.name) let _Columns = initApiColumnsForDto(_list,this.$route.name,this)
this.apiColumns_Table = this.initTableColumns(_Columns) this.apiColumns_Table = this.initTableColumns(_Columns)
this.apiColumns_DesTions = _Columns this.apiColumns_DesTions = _Columns
// 页面数据处理 // 页面数据处理
@ -312,30 +238,54 @@ export const tableMixins = {
this.Loading.DrawerLoading = true this.Loading.DrawerLoading = true
this.displayDialog.detailsDialog = true; this.displayDialog.detailsDialog = true;
let _url = this.URLOption_detail ? this.URLOption_detail : this.URLOption_base let _url = this.URLOption_detail ? this.URLOption_detail : this.URLOption_base
getDetailed(val.id, _url) // 有主表信息子表(表头处理)
.then(res=>{ if(!this.URLOption.isMaster && this.URLOption.hasDetail){
// 打印使用的全部数据存储 let _showMasterUrl = this.URLOption.mainShowMasterUrl
this.tableDataDetails = JSON.parse(JSON.stringify(res)) if(!this.URLOption.mainShowMasterUrl){
// 数据处理 _showMasterUrl = sliceStrEndDelete(this.URLOption_detail,'-Detail')
this.propsData = res }
if (res.details) { Promise.all([
// 表头处理 getDetailed(val.id, _url),
let _parentName = this.URLOption_detailList.substr(0,this.URLOption_detailList.indexOf('/')) getDetailed(val[this.URLOption.mainShowMasterId || this.URLOption.masterId || this.allUrlOption.defalutMasterId || 'masterId'], _showMasterUrl)
this.apiColumns_DetailsTable = this.initTableColumns(this.initApiColumnsForDto(res.details[0],_parentName),'detail_api') ]).then((res) => {
if(this.$refs.currenDrawer_Ref){ let _allRes = JSON.parse(JSON.stringify(res[0]))
this.$refs.currenDrawer_Ref.getDetailList(res,()=>{ _allRes.masterInfo = res[1]
this.inlineDialogCallback() this.initInlineHttpBack(_allRes)
},()=>{ }).catch(()=>{
this.Loading.DrawerLoading = false
})
}
}else{
this.Loading.DrawerLoading = false
}
})
.catch(err=>{
this.Loading.DrawerLoading = false this.Loading.DrawerLoading = false
}) })
}
// 没有主表信息
else{
getDetailed(val.id, _url)
.then(res=>{
this.initInlineHttpBack(res)
})
.catch(err=>{
this.Loading.DrawerLoading = false
})
}
},
// 查看详情获取返回值后处理
initInlineHttpBack(res){
// 打印使用的全部数据存储
this.tableDataDetails = JSON.parse(JSON.stringify(res))
// 数据处理
this.propsData = res
if (res.details) {
// 表头处理
let _parentName = this.URLOption_detailList.substr(0,this.URLOption_detailList.indexOf('/'))
this.apiColumns_DetailsTable = this.initTableColumns(initApiColumnsForDto(res.details[0],_parentName,this),'detail_api')
if(this.$refs.currenDrawer_Ref){
this.$refs.currenDrawer_Ref.getDetailList(res,()=>{
this.inlineDialogCallback()
},()=>{
this.Loading.DrawerLoading = false
})
}
}else{
this.Loading.DrawerLoading = false
}
}, },
// 前端分页处理 // 前端分页处理
// detailListPageFromFE(data){ // detailListPageFromFE(data){

6
PC/InterFace.Dash/src/mixins/mixins.js

@ -8,6 +8,9 @@ import { getLoginName } from "@/utils/auth"
export const mixins = { export const mixins = {
data() { data() {
return { return {
allUrlOption:allUrlOption,
// 当前路由配置
URLOption:allUrlOption[this.$route.name],
//主表-列表 //主表-列表
URLOption_base:allUrlOption[this.$route.name].baseURL, URLOption_base:allUrlOption[this.$route.name].baseURL,
//主表-明细 //主表-明细
@ -23,7 +26,7 @@ export const mixins = {
//明细-查看主表 //明细-查看主表
URLOption_parent:allUrlOption[this.$route.name].parentURL ? allUrlOption[this.$route.name].parentURL : allUrlOption[this.$route.name].detailURL, URLOption_parent:allUrlOption[this.$route.name].parentURL ? allUrlOption[this.$route.name].parentURL : allUrlOption[this.$route.name].detailURL,
//明细-查看主表的连接id //明细-查看主表的连接id
URLOption_masterId:allUrlOption[this.$route.name].masterId || 'masterId', URLOption_masterId:allUrlOption[this.$route.name].masterId || allUrlOption.defalutMasterId || 'masterId',
//明细-查看主表的连接title名称 //明细-查看主表的连接title名称
URLOption_masterName:allUrlOption[this.$route.name].masterName, URLOption_masterName:allUrlOption[this.$route.name].masterName,
// 列表-明细-查看详情标题名称 // 列表-明细-查看详情标题名称
@ -65,7 +68,6 @@ export const mixins = {
name: "determine" name: "determine"
}, },
], ],
addEditApiType: null,//Api新增编辑方式(add,edit) addEditApiType: null,//Api新增编辑方式(add,edit)
editFromApiRowData:null,//Api编辑方式的默认值 editFromApiRowData:null,//Api编辑方式的默认值
} }

34
PC/InterFace.Dash/src/utils/baseData/urlOption.js

@ -1,4 +1,6 @@
// 添加页面需要配置位置 // 默认配置
export const defalutMasterId = 'masterId'
// 示例数据 // 示例数据
export const TestSchool = { export const TestSchool = {
baseURL:'TestSchool/base',//主表-列表 baseURL:'TestSchool/base',//主表-列表
@ -16,6 +18,7 @@ export const ExportCustomUserSetting = {
// baseURL:'get-by-user-and-table-name',//主表-列表 // baseURL:'get-by-user-and-table-name',//主表-列表
baseURL:'ExportCustomUserSetting/base',//主表-列表 baseURL:'ExportCustomUserSetting/base',//主表-列表
detailURL:'app/export-custom-user-setting',//主表-明细 + 明细-查看主表 detailURL:'app/export-custom-user-setting',//主表-明细 + 明细-查看主表
hasDetail:false,
} }
// 接口看板管理-AsnMstr【主子表】 // 接口看板管理-AsnMstr【主子表】
@ -25,19 +28,23 @@ export const AsnMstr = {
// detailInfoName:'asnNbr',//主表-明细查看详情的title名称 // detailInfoName:'asnNbr',//主表-明细查看详情的title名称
detailListURL:'AsnDet/base',//明细-列表, detailListURL:'AsnDet/base',//明细-列表,
masterId:'asnMstrId',//明细获取主表信息的masterId masterId:'asnMstrId',//明细获取主表信息的masterId
masterName:'asnNbr'//明细获取主表信息的title名称 masterName:'asnNbr',//明细获取主表信息的title名称
hasDetail:true,
isMaster:true
} }
// 接口看板管理-IncomingData // 接口看板管理-IncomingData
export const IncomingData = { export const IncomingData = {
baseURL:'IncomingData/base',//主表-列表 baseURL:'IncomingData/base',//主表-列表
detailURL:'app/incoming-data',//主表-明细 + 明细-查看主表 detailURL:'app/incoming-data',//主表-明细 + 明细-查看主表
hasDetail:false
} }
// 接口看板管理-IncomingDataHistory // 接口看板管理-IncomingDataHistory
export const IncomingDataHistory = { export const IncomingDataHistory = {
baseURL:'IncomingDataHistory/base',//主表-列表 baseURL:'IncomingDataHistory/base',//主表-列表
detailURL:'app/incoming-data-history',//主表-明细 + 明细-查看主表 detailURL:'app/incoming-data-history',//主表-明细 + 明细-查看主表
hasDetail:false
} }
@ -45,60 +52,70 @@ export const IncomingDataHistory = {
export const OutgoingData = { export const OutgoingData = {
baseURL:'OutgoingData/base',//主表-列表 baseURL:'OutgoingData/base',//主表-列表
detailURL:'app/outgoing-data',//主表-明细 + 明细-查看主表 detailURL:'app/outgoing-data',//主表-明细 + 明细-查看主表
hasDetail:false
} }
// 接口看板管理-OutgoingDataHistory // 接口看板管理-OutgoingDataHistory
export const OutgoingDataHistory = { export const OutgoingDataHistory = {
baseURL:'OutgoingDataHistory/base',//主表-列表 baseURL:'OutgoingDataHistory/base',//主表-列表
detailURL:'app/outgoing-data-history',//主表-明细 + 明细-查看主表 detailURL:'app/outgoing-data-history',//主表-明细 + 明细-查看主表
hasDetail:false
} }
// 接口看板管理-MessageReceive // 接口看板管理-MessageReceive
export const MessageReceive = { export const MessageReceive = {
baseURL:'MessageReceive/base',//主表-列表 baseURL:'MessageReceive/base',//主表-列表
detailURL:'app/message-receive',//主表-明细 + 明细-查看主表 detailURL:'app/message-receive',//主表-明细 + 明细-查看主表
hasDetail:false
} }
// 接口看板管理-MesProductL7PartsNote // 接口看板管理-MesProductL7PartsNote
export const MesProductL7PartsNote = { export const MesProductL7PartsNote = {
baseURL:'MesProductL7PartsNote/base',//主表-列表 baseURL:'MesProductL7PartsNote/base',//主表-列表
detailURL:'app/mes-product-l7Parts-note',//主表-明细 + 明细-查看主表 detailURL:'app/mes-product-l7Parts-note',//主表-明细 + 明细-查看主表
hasDetail:false
} }
// 接口看板管理-Bom // 接口看板管理-Bom
export const Bom = { export const Bom = {
baseURL:'Bom/base',//主表-列表 baseURL:'Bom/base',//主表-列表
detailURL:'app/bom',//主表-明细 + 明细-查看主表 detailURL:'app/bom',//主表-明细 + 明细-查看主表
hasDetail:false
} }
// 接口看板管理-CustPart // 接口看板管理-CustPart
export const CustPart = { export const CustPart = {
baseURL:'CustPart/base',//主表-列表 baseURL:'CustPart/base',//主表-列表
detailURL:'app/cust-part',//主表-明细 + 明细-查看主表 detailURL:'app/cust-part',//主表-明细 + 明细-查看主表
hasDetail:false
} }
// 接口看板管理-Cust // 接口看板管理-Cust
export const Cust = { export const Cust = {
baseURL:'Cust/base',//主表-列表 baseURL:'Cust/base',//主表-列表
detailURL:'app/cust',//主表-明细 + 明细-查看主表 detailURL:'app/cust',//主表-明细 + 明细-查看主表
hasDetail:false
} }
// 接口看板管理-Inventory // 接口看板管理-Inventory
export const Inventory = { export const Inventory = {
baseURL:'Inventory/base',//主表-列表 baseURL:'Inventory/base',//主表-列表
detailURL:'app/inventory',//主表-明细 + 明细-查看主表 detailURL:'app/inventory',//主表-明细 + 明细-查看主表
hasDetail:false
} }
// 接口看板管理-Loc // 接口看板管理-Loc
export const Loc = { export const Loc = {
baseURL:'Loc/base',//主表-列表 baseURL:'Loc/base',//主表-列表
detailURL:'app/loc',//主表-明细 + 明细-查看主表 detailURL:'app/loc',//主表-明细 + 明细-查看主表
hasDetail:false
} }
// 接口看板管理-Part // 接口看板管理-Part
export const Part = { export const Part = {
baseURL:'Part/base',//主表-列表 baseURL:'Part/base',//主表-列表
detailURL:'app/part',//主表-明细 + 明细-查看主表 detailURL:'app/part',//主表-明细 + 明细-查看主表
hasDetail:false
} }
// 接口看板管理-PoMstr【主子表】 // 接口看板管理-PoMstr【主子表】
@ -108,19 +125,23 @@ export const PoMstr = {
// detailInfoName:'asnNbr',//主表-明细查看详情的title名称 // detailInfoName:'asnNbr',//主表-明细查看详情的title名称
detailListURL:'PoDet/base',//明细-列表, detailListURL:'PoDet/base',//明细-列表,
masterId:'poMstrId',//明细获取主表信息的masterId masterId:'poMstrId',//明细获取主表信息的masterId
masterName:'poNbr'//明细获取主表信息的title名称 masterName:'poNbr',//明细获取主表信息的title名称
hasDetail:true,
isMaster:true
} }
// 接口看板管理-PrhHist // 接口看板管理-PrhHist
export const PrhHist = { export const PrhHist = {
baseURL:'PrhHist/base',//主表-列表 baseURL:'PrhHist/base',//主表-列表
detailURL:'app/prh-hist',//主表-明细 + 明细-查看主表 detailURL:'app/prh-hist',//主表-明细 + 明细-查看主表
hasDetail:false
} }
// 接口看板管理-ProdLine // 接口看板管理-ProdLine
export const ProdLine = { export const ProdLine = {
baseURL:'ProdLine/base',//主表-列表 baseURL:'ProdLine/base',//主表-列表
detailURL:'app/prod-line',//主表-明细 + 明细-查看主表 detailURL:'app/prod-line',//主表-明细 + 明细-查看主表
hasDetail:false
} }
// 接口看板管理-ReceiptMstr【主子表】 // 接口看板管理-ReceiptMstr【主子表】
@ -131,6 +152,8 @@ export const ReceiptMstr = {
detailListURL:'ReceiptDet/base',//明细-列表, detailListURL:'ReceiptDet/base',//明细-列表,
masterId:'receiptMstrId',//明细获取主表信息的masterId masterId:'receiptMstrId',//明细获取主表信息的masterId
// masterName:'receiptMstrAsnNbr'//明细获取主表信息的title名称 // masterName:'receiptMstrAsnNbr'//明细获取主表信息的title名称
hasDetail:true,
isMaster:true
} }
// 接口看板管理-ReturnMstr【主子表】 // 接口看板管理-ReturnMstr【主子表】
@ -141,23 +164,28 @@ export const ReturnMstr = {
detailListURL:'ReturnDet/base',//明细-列表, detailListURL:'ReturnDet/base',//明细-列表,
masterId:'returnMstrId',//明细获取主表信息的masterId masterId:'returnMstrId',//明细获取主表信息的masterId
// masterName:'returnMstrAsnNbr'//明细获取主表信息的title名称 // masterName:'returnMstrAsnNbr'//明细获取主表信息的title名称
hasDetail:true,
isMaster:true
} }
// 接口看板管理-VendPart // 接口看板管理-VendPart
export const VendPart = { export const VendPart = {
baseURL:'VendPart/base',//主表-列表 baseURL:'VendPart/base',//主表-列表
detailURL:'app/vend-part',//主表-明细 + 明细-查看主表 detailURL:'app/vend-part',//主表-明细 + 明细-查看主表
hasDetail:false
} }
// 接口看板管理-Vend // 接口看板管理-Vend
export const Vend = { export const Vend = {
baseURL:'Vend/base',//主表-列表 baseURL:'Vend/base',//主表-列表
detailURL:'app/vend',//主表-明细 + 明细-查看主表 detailURL:'app/vend',//主表-明细 + 明细-查看主表
hasDetail:false
} }
// 接口看板管理-SodDet // 接口看板管理-SodDet
export const SodDet = { export const SodDet = {
baseURL:'SodDet/base',//主表-列表 baseURL:'SodDet/base',//主表-列表
detailURL:'app/sod-det',//主表-明细 + 明细-查看主表 detailURL:'app/sod-det',//主表-明细 + 明细-查看主表
hasDetail:false
} }

98
PC/InterFace.Dash/src/utils/index.js

@ -3,6 +3,7 @@
*/ */
import {fileStorage, getPageList } from '@/api/wms-api' import {fileStorage, getPageList } from '@/api/wms-api'
import store from '@/store' import store from '@/store'
import i18n from "@/lang"
/** /**
* @param {string} url * @param {string} url
@ -429,3 +430,100 @@ export function firstWordSizeChange (str,type='Lower') {
} }
} }
// get-dto-column-type接口表头类型初始化
export function initApiColumnsForDto (list,titleName,that) {
let data = that.$store.getters.dtoColumnTypes
let _coloums = data[titleName].S
let _Columns_Table = []
if(_coloums){
let _data = _coloums.dtoList
_data.forEach(item=>{
// 如果list接口存在数据 ,与list接口返回字段比较处理,list接口存在的话则追加
let _if = firstWordSizeChange(item.name) != 'details'
if(list){
_if = firstWordSizeChange(item.name) in list && firstWordSizeChange(item.name) != 'details'
}
if(_if){
_Columns_Table.push(item)
}
})
}
if(list){
_Columns_Table = _Columns_Table.concat(specialAddColumns(list,titleName))
}
return _Columns_Table
}
// 特殊字段转义处理(api中没有的字段特殊处理)
export function specialAddColumns(list,titleName){
let _apiName = titleName
let _special_list=[]
// creationTime
if('creationTime' in list){
_special_list.push(
{
"name": "CreationTime",
"apiBaseType": "datetime",
"baseApiName": _apiName + 'CreationTime',
"label": zhApiColumnsLable(_apiName + 'CreationTime') || i18n.t('columNames.CreationTime'),
"prop": "creationTime",
}
)
}
// creatorId
if('creatorId' in list){
_special_list.push(
{
"name": "CreatorId",
"apiBaseType": "string",
"baseApiName": _apiName + 'CreatorId',
"label": zhApiColumnsLable(_apiName + 'CreatorId') || i18n.t('columNames.CreatorId'),
"prop": "creatorId",
}
)
}
// lastModificationTime
if('lastModificationTime' in list){
_special_list.push(
{
"name": "LastModificationTime",
"apiBaseType": "datetime",
"baseApiName": _apiName + 'LastModificationTime',
"label": zhApiColumnsLable(_apiName + 'LastModificationTime') || i18n.t('columNames.LastModificationTime'),
"prop": "lastModificationTime",
}
)
}
// lastModifierId
if('lastModifierId' in list){
_special_list.push(
{
"name": "LastModifierId",
"apiBaseType": "string",
"baseApiName": _apiName + 'LastModifierId',
"label": zhApiColumnsLable(_apiName + 'LastModifierId') || i18n.t('columNames.LastModifierId'),
"prop": "lastModifierId",
}
)
}
// tenantId
if('tenantId' in list){
_special_list.push(
{
"name": "TenantId",
"apiBaseType": "string",
"baseApiName": _apiName + 'TenantId',
"label": zhApiColumnsLable(_apiName + 'TenantId') || i18n.t('columNames.TenantId'),
"prop": "tenantId",
}
)
}
return _special_list
}
// 从字段中删除最后某字段
export function sliceStrEndDelete(str,deleteStr){
let _d_l = str.length - deleteStr.length
return str.slice(0,_d_l)
}

24
PC/UI.WinIn.FasterZ.Inventory/README.md

@ -124,3 +124,27 @@ pointNumberFixed 组合上方validType值仅等于pointNumber时:
小数点后方保留位数,如不填写默认为100位 小数点后方保留位数,如不填写默认为100位
<validType>+<pointNumberFixed>示例: <validType>+<pointNumberFixed>示例:
{ type:"input", label:"金额", prop:"money", validType:'pointNumber',pointNumberFixed:2}, { type:"input", label:"金额", prop:"money", validType:'pointNumber',pointNumberFixed:2},
[urlOpion示例]
// 添加页面需要配置位置
// 示例数据
export const TestSchool = {
baseURL:'TestSchool/base',//主表-列表
detailURL:'app/test-school',//主表-明细 + 明细-查看主表
// detailInfoName:'asnNbr',//主表-明细查看详情的title名称
detailListURL:'TestStudentDetail/base',//明细-列表,
masterId:'masterId',//明细获取主表信息的masterId,默认依次为[默认配置defalutMasterId,固定值masterId]
masterName:'studentName'//明细获取主表信息的title名称
// parentURL:null,//明细-查看主表:特殊接口,如果没有则走detailURL
// deleteURL:null,//删除特殊URL
// addURL:null,//新增特殊URL
// editURL:null,//编辑特殊URL
// exportURL:'exportURL',//导出特殊URL
<!-- 20231124 有主表的子列表 查看详情的主表信息处理 -->
//有主表的子表单页的主表信息接口,默认为当前的[detailURL]去掉[-Detail]
// mainShowMasterUrl:null,
//有主表的子表单页的主表链接参数,默认依次为[默认配置defalutMasterId,上方配置中masterId,固定值masterId]
// mainShowMasterId:'masterId',
//有主表的子表单页的主表路由[用于显示列转义],默认为[当前路由]去掉[Detail]
// masterRoute:null,
}

54
PC/UI.WinIn.FasterZ.Inventory/src/components/commonTabel-drawer/index.vue

@ -49,6 +49,7 @@
@handleClick="handleClick" @handleClick="handleClick"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 详情 -->
<curren-descriptions <curren-descriptions
border border
v-if="scope.value == 'xq'" v-if="scope.value == 'xq'"
@ -59,6 +60,17 @@
:propsData="propsData" :propsData="propsData"
> >
</curren-descriptions> </curren-descriptions>
<!-- 主表信息 -->
<curren-descriptions
border
v-if="scope.value == 'masterInfo'"
:column="column"
:direction="direction"
:colon="false"
:tabsDesTions="masterColums"
:propsData="propsData.masterInfo"
>
</curren-descriptions>
<!-- 明细 包含分页 头部按钮等 --> <!-- 明细 包含分页 头部按钮等 -->
<tablePagination <tablePagination
ref="tablePaginationForMX_Ref" ref="tablePaginationForMX_Ref"
@ -104,11 +116,12 @@
</template> </template>
</umyTable> </umyTable>
<!-- 自定义扩展 --> <!-- 自定义扩展 -->
<umyTable <!-- <umyTable
v-if=" v-if="
scope.value == zdyValue && scope.value == zdyValue &&
scope.value != 'xq' && scope.value != 'xq' &&
scope.value != 'mx' && scope.value != 'mx' &&
scope.value != 'masterInfo' &&
scope.value != 'hz' && scope.value != 'hz' &&
scope.value != 'zwlcj' scope.value != 'zwlcj'
" "
@ -127,7 +140,7 @@
<template> <template>
<slot></slot> <slot></slot>
</template> </template>
</umyTable> </umyTable> -->
</template> </template>
</curren-tabs> </curren-tabs>
</div> </div>
@ -171,6 +184,10 @@ import pagination from "@/components/Pagination"
import rowDrop from "@/components/rowDrop/index.vue" import rowDrop from "@/components/rowDrop/index.vue"
import * as allUrlOption from '@/utils/baseData/urlOption' import * as allUrlOption from '@/utils/baseData/urlOption'
import { LoadingMixins } from "@/mixins/LoadingMixins"; import { LoadingMixins } from "@/mixins/LoadingMixins";
import {
initApiColumnsForDto,
sliceStrEndDelete
} from '@/utils/index'
export default { export default {
name: 'currenTabel-drawer', name: 'currenTabel-drawer',
components: { components: {
@ -309,7 +326,8 @@ export default {
// tabs // tabs
if (this.dropdownTabsData.length !== 0) { if (this.dropdownTabsData.length !== 0) {
return this.dropdownTabsData return this.dropdownTabsData
} else { }
else {
// //
// if (Object.keys(this.propsData).length != 0) { // if (Object.keys(this.propsData).length != 0) {
if (Object.keys(this.propsData)) { if (Object.keys(this.propsData)) {
@ -317,6 +335,14 @@ export default {
label: "详情", label: "详情",
name: 'xq' name: 'xq'
}] }]
if(this.propsData.masterInfo && this.propsData.masterInfo.length > 0){
this.initDropdownTabsData.push({
label: "主表信息",
name: 'masterInfo'
})
let _master_name = this.URLOption.masterRoute || sliceStrEndDelete(this.$route.name,'Detail')
this.masterColums = initApiColumnsForDto(this.propsData.masterInfo,_master_name,this)
}
// 使 // 使
if(this.propsData.details){ if(this.propsData.details){
this.initDropdownTabsData.push({ this.initDropdownTabsData.push({
@ -343,9 +369,9 @@ export default {
detailHeaderButton:null,//- detailHeaderButton:null,//-
detailInfoTableData:null,//- detailInfoTableData:null,//-
detailInfoTitle:null,//-title detailInfoTitle:null,//-title
otherData:[], // tabs // otherData:[], // tabs
zdyTableColumns:[], // // zdyTableColumns:[], //
zdyValue:'', // // zdyValue:'', //
// firstTabs:'xq', // firstTabs:'xq',
initDropdownTabsData:[ initDropdownTabsData:[
{ {
@ -375,10 +401,14 @@ export default {
MaxResultCount: 20, MaxResultCount: 20,
}, },
totalCountForDetail:0, totalCountForDetail:0,
//-id
URLOption:allUrlOption[this.$route.name],
//-id //-id
URLOption_masterId:allUrlOption[this.$route.name].masterId || 'masterId', URLOption_masterId:allUrlOption[this.$route.name].masterId || allUrlOption.defalutMasterId || 'masterId',
//- //-
URLOption_detailList:allUrlOption[this.$route.name].detailListURL, URLOption_detailList:allUrlOption[this.$route.name].detailListURL,
//
masterColums:null
} }
}, },
methods: { methods: {
@ -574,7 +604,7 @@ export default {
// tabs // tabs
handleClick (val) { handleClick (val) {
this.$emit("currenTabsChange", val);//tab this.$emit("currenTabsChange", val);//tab
this.zdyValue = val.name // this.zdyValue = val.name
this.dropdownTabsData.forEach( item => { this.dropdownTabsData.forEach( item => {
if (item.name == val.name) { if (item.name == val.name) {
let parent = this.$parent let parent = this.$parent
@ -582,12 +612,12 @@ export default {
// //
parent.firstTabs = val.name parent.firstTabs = val.name
if (val.name == 'xq' || val.name == 'mx' || val.name == 'hz') { if (val.name == 'xq' || val.name == 'mx' || val.name == 'hz') {
this.zdyTableColumns = [] // this.zdyTableColumns = []
this.otherData = [] // this.otherData = []
parent.tableLoading = false parent.tableLoading = false
} else { } else {
this.zdyTableColumns = [] // this.zdyTableColumns = []
this.otherData = [] // this.otherData = []
// this.firstTabs = val.name // this.firstTabs = val.name
// tab // tab
// if (item.functionName == 'getListByItemcode') { // if (item.functionName == 'getListByItemcode') {

403
PC/UI.WinIn.FasterZ.Inventory/src/components/filterForDetailPage/index.vue

@ -120,219 +120,216 @@
</el-table> --> </el-table> -->
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import currenDescriptions from "@/components/currenDescriptions" import currenDescriptions from "@/components/currenDescriptions"
import { tableMixins } from "@/mixins/TableMixins"; import { tableMixins } from "@/mixins/TableMixins";
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins"; import { TableHeaderMixins } from "@/mixins/TableHeaderMixins";
import { LoadingMixins } from "@/mixins/LoadingMixins"; import { LoadingMixins } from "@/mixins/LoadingMixins";
import { mixins } from "@/mixins/mixins"; import { mixins } from "@/mixins/mixins";
import { filterSelectMixins } from '@/mixins/filter-Select' import { filterSelectMixins } from '@/mixins/filter-Select'
import {getListDesById,getPageListForDetail} from "@/api/wms-api" import {getListDesById,getPageListForDetail} from "@/api/wms-api"
export default { import { initApiColumnsForDto } from '@/utils/index'
name: 'filterForDetailPage', export default {
mixins: [ name: 'filterForDetailPage',
tableMixins, mixins: [
TableHeaderMixins, tableMixins,
mixins, TableHeaderMixins,
filterSelectMixins, mixins,
LoadingMixins filterSelectMixins,
], LoadingMixins
components:{ ],
currenDescriptions components:{
}, currenDescriptions
props: { },
// app-main100% props: {
setUTableHeight: { // app-main100%
type: Number, setUTableHeight: {
default: 340
},
//
isShowIndex:{
type: Boolean,
default: false
},
//
tableSelection: {
type: Boolean,
default: false
},
cellStyle: {
type: Function,
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'
// showParentfreshfilterfield
return ['showParent','fresh','filter','field'];
}
},
// 2
column: {
type: Number, type: Number,
default: 2 default: 340
}, },
// //
direction: { isShowIndex:{
type: Boolean,
default: false
},
//
tableSelection: {
type: Boolean,
default: false
},
cellStyle: {
type: Function,
default: () => {
return Function;
}
},
//
showOverflowTooltip:{
type: Boolean,
default: false,
},
// api
DeleteApi: {
type: String, type: String,
default: 'horizontal' default: null
},
rowMaxHeight:{
type:String,
default:'calc(90vh - 450px)'
},
}, },
data () { // -
return { parentColumns:{
dialogShow:true, type: Array,
// URLOption_detailList:allUrlOption[this.$route.name].detailListURL,//- default: null
// URLOption_masterId:allUrlOption[this.$route.name].masterId || 'masterId',//-id },
// URLOption_masterName:allUrlOption[this.$route.name].masterName,//-//-title showHandleButtons:{
// URLOption_parent:allUrlOption[this.$route.name].parentURL ? allUrlOption[this.$route.name].parentURL : allUrlOption[this.$route.name].detailURL,//- type:Array,
currenButtonData: [],// default:() => {
operaButtons:[],// //'add','edit' 'delete'
showParentDialog:false,// // showParentfreshfilterfield
showParentTitle:null,//-title return ['showParent','fresh','filter','field'];
showParentTableData:null,//-
showParentLoading:false,//-
listColumns:[],//
} }
}, },
activated(){ // 2
// column: {
this.dialogShow = false type: Number,
this.$nextTick(() => { default: 2
this.dialogShow = true },
}); //
direction: {
type: String,
default: 'horizontal'
}, },
mounted(){ rowMaxHeight:{
this.paging() type:String,
this.initHandleButtons() default:'calc(90vh - 450px)'
}, },
methods: { },
rowDropForDetail(data,type){ data () {
this.listColumns = data return {
this.$emit("rowDropForDetail", data,type) dialogShow:true,
}, currenButtonData: [],//
// operaButtons:[],//
initHandleButtons(){ showParentDialog:false,//
// showParentTitle:null,//-title
let _arr_header = [] showParentTableData:null,//-
if(this.showHandleButtons.indexOf('add') >= 0){_arr_header.push(this.defaultAddBtn())} showParentLoading:false,//-
if(this.showHandleButtons.indexOf('field') >= 0){_arr_header.push(this.defaultFieldSettingBtn())} listColumns:[],//
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 activated(){
//
this.dialogShow = false
this.$nextTick(() => {
this.dialogShow = true
});
},
mounted(){
this.paging()
this.initHandleButtons()
},
methods: {
rowDropForDetail(data,type){
this.listColumns = data
this.$emit("rowDropForDetail", data,type)
},
//
initHandleButtons(){
//
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 = initApiColumnsForDto(res.items[0],_parentName,this)
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.$message.error("数据获取失败") this.tableData = []
}) res.items.forEach(item=>{
}, item.deleteTipVisible = false
// this.tableData.push(item)
showParentHandleForDetail(data){ })
this.showParentTitle = `${data[this.URLOption_masterName] || ''} 主表信息` this.totalCount = res.totalCount
this.showParentDialog = true }
this.showParentLoading = true this.pagingCallback(callback)
getListDesById(this.URLOption_parent,data[this.URLOption_masterId]) })
.then(res => { .catch(err=>{
this.showParentTableData = res this.Loading.tableLoading = false
this.showParentLoading = false this.$message.error("数据获取失败")
}) })
.catch(err => { },
this.showParentLoading = false //
this.$message.error("主表信息获取失败!") showParentHandleForDetail(data){
}) this.showParentTitle = `${data[this.URLOption_masterName] || ''} 主表信息`
}, this.showParentDialog = true
// this.showParentLoading = true
editHandleForDetail(data){ getListDesById(this.URLOption_parent,data[this.URLOption_masterId])
console.log(data) .then(res => {
}, this.showParentTableData = res
// this.showParentLoading = false
deleteHandleForDetail(data){ })
this.Loading.appMainLoading = true .catch(err => {
data.deleteTipVisible = false this.showParentLoading = false
// interfaceApi[this.DeleteApi](data.id).then(res => { this.$message.error("主表信息获取失败!")
// this.$successMsg('!') })
// this.oldSkipCount = 1 },
// this.Loading.appMainLoading = false //
// this.paging() editHandleForDetail(data){
// }).catch(err => { console.log(data)
// this.Loading.appMainLoading = false },
// this.$message.error("!") //
// }) 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> }
<style lang="scss"> </script>
.filterForDetailPage { <style lang="scss">
.filterForDetailPage {
.mainTable-dialog{ .mainTable-dialog{
.el-dialog{ .el-dialog{
height: calc(100% - 100px); height: calc(100% - 100px);
}
}
.el-dialog__body{
min-height: 200px;
padding-bottom: 20px !important;
} }
}
.filterForDetailPage-list{
height: calc(100%);
overflow: auto;
} }
</style> .el-dialog__body{
min-height: 200px;
padding-bottom: 20px !important;
}
}
.filterForDetailPage-list{
height: calc(100%);
overflow: auto;
}
</style>

184
PC/UI.WinIn.FasterZ.Inventory/src/mixins/TableMixins.js

@ -1,11 +1,13 @@
import i18n from "@/lang"
import { import {
getPageList, getPageList,
getDetailed, getDetailed,
postDelete, postDelete,
ApiTypeDelete ApiTypeDelete
} from '@/api/wms-api' } from '@/api/wms-api'
import { zhApiColumnsLable,firstWordSizeChange } from '@/utils/index' import {
initApiColumnsForDto,
sliceStrEndDelete
} from '@/utils/index'
export const tableMixins = { export const tableMixins = {
data() { data() {
return { return {
@ -103,9 +105,22 @@ export const tableMixins = {
} }
// 编辑 api // 编辑 api
else if (item.name == "editFromApi") { else if (item.name == "editFromApi") {
this.addEditApiType = 'edit' // this.addEditApiType = 'edit'
this.editFromApiRowData = row // this.editFromApiRowData = row
this.displayDialog.addEditApiDialog = true; // this.displayDialog.addEditApiDialog = true;
let _url = this.URLOption_detail ? this.URLOption_detail : this.URLOption_base
this.Loading.tableLoading = true
getDetailed(row.id, _url)
.then(res=>{
this.addEditApiType = 'edit'
this.editFromApiRowData = res
this.displayDialog.addEditApiDialog = true;
this.Loading.tableLoading = false
})
.catch(err=>{
this.Loading.tableLoading = false
})
} }
// 删除 // 删除
else if (item.name == "delete"){ else if (item.name == "delete"){
@ -158,95 +173,6 @@ export const tableMixins = {
// if(detailsTable && detailsTable[this.$route.name])this.apiColumns_DetailsTable = this.initTableColumns(detailsTable[this.$route.name],'detail_api') // if(detailsTable && detailsTable[this.$route.name])this.apiColumns_DetailsTable = this.initTableColumns(detailsTable[this.$route.name],'detail_api')
// if(detailsPage && detailsPage[this.$route.name])this.apiColumns_DetailsPage = this.initTableColumns(detailsPage[this.$route.name],'detailPage_api') // if(detailsPage && detailsPage[this.$route.name])this.apiColumns_DetailsPage = this.initTableColumns(detailsPage[this.$route.name],'detailPage_api')
// }, // },
// get-dto-column-type接口表头类型初始化
initApiColumnsForDto(list,titleName){
let data = this.$store.getters.dtoColumnTypes
let _coloums = data[titleName].S
let _Columns_Table = []
if(_coloums){
let _data = _coloums.dtoList
_data.forEach(item=>{
// 如果list接口存在数据 ,与list接口返回字段比较处理,list接口存在的话则追加
let _if = firstWordSizeChange(item.name) != 'details'
if(list){
_if = firstWordSizeChange(item.name) in list && firstWordSizeChange(item.name) != 'details'
}
if(_if){
_Columns_Table.push(item)
}
})
}
if(list){
_Columns_Table = _Columns_Table.concat(this.specialAddColumns(list,titleName))
}
return _Columns_Table
},
// 添加特殊字段(api中没有的字段特殊处理)
specialAddColumns(list,titleName){
let _apiName = titleName
let _special_list=[]
// creationTime
if('creationTime' in list){
_special_list.push(
{
"name": "CreationTime",
"apiBaseType": "datetime",
"baseApiName": _apiName + 'CreationTime',
"label": zhApiColumnsLable(_apiName + 'CreationTime') || i18n.t('columNames.CreationTime'),
"prop": "creationTime",
}
)
}
// creatorId
if('creatorId' in list){
_special_list.push(
{
"name": "CreatorId",
"apiBaseType": "string",
"baseApiName": _apiName + 'CreatorId',
"label": zhApiColumnsLable(_apiName + 'CreatorId') || i18n.t('columNames.CreatorId'),
"prop": "creatorId",
}
)
}
// lastModificationTime
if('lastModificationTime' in list){
_special_list.push(
{
"name": "LastModificationTime",
"apiBaseType": "datetime",
"baseApiName": _apiName + 'LastModificationTime',
"label": zhApiColumnsLable(_apiName + 'LastModificationTime') || i18n.t('columNames.LastModificationTime'),
"prop": "lastModificationTime",
}
)
}
// lastModifierId
if('lastModifierId' in list){
_special_list.push(
{
"name": "LastModifierId",
"apiBaseType": "string",
"baseApiName": _apiName + 'LastModifierId',
"label": zhApiColumnsLable(_apiName + 'LastModifierId') || i18n.t('columNames.LastModifierId'),
"prop": "lastModifierId",
}
)
}
// tenantId
if('tenantId' in list){
_special_list.push(
{
"name": "TenantId",
"apiBaseType": "string",
"baseApiName": _apiName + 'TenantId',
"label": zhApiColumnsLable(_apiName + 'TenantId') || i18n.t('columNames.TenantId'),
"prop": "tenantId",
}
)
}
return _special_list
},
//渲染数据 //渲染数据
paging(callback,repeat) { paging(callback,repeat) {
this.Loading.tableLoading = true; this.Loading.tableLoading = true;
@ -255,7 +181,7 @@ export const tableMixins = {
.then(res=>{ .then(res=>{
// 表头处理 // 表头处理
let _list = res.items && res.items.length > 0 ? res.items[0] : null let _list = res.items && res.items.length > 0 ? res.items[0] : null
let _Columns = this.initApiColumnsForDto(_list,this.$route.name) let _Columns = initApiColumnsForDto(_list,this.$route.name,this)
this.apiColumns_Table = this.initTableColumns(_Columns) this.apiColumns_Table = this.initTableColumns(_Columns)
this.apiColumns_DesTions = _Columns this.apiColumns_DesTions = _Columns
// 页面数据处理 // 页面数据处理
@ -312,30 +238,54 @@ export const tableMixins = {
this.Loading.DrawerLoading = true this.Loading.DrawerLoading = true
this.displayDialog.detailsDialog = true; this.displayDialog.detailsDialog = true;
let _url = this.URLOption_detail ? this.URLOption_detail : this.URLOption_base let _url = this.URLOption_detail ? this.URLOption_detail : this.URLOption_base
getDetailed(val.id, _url) // 有主表信息子表(表头处理)
.then(res=>{ if(!this.URLOption.isMaster && this.URLOption.hasDetail){
// 打印使用的全部数据存储 let _showMasterUrl = this.URLOption.mainShowMasterUrl
this.tableDataDetails = JSON.parse(JSON.stringify(res)) if(!this.URLOption.mainShowMasterUrl){
// 数据处理 _showMasterUrl = sliceStrEndDelete(this.URLOption_detail,'-Detail')
this.propsData = res }
if (res.details) { Promise.all([
// 表头处理 getDetailed(val.id, _url),
let _parentName = this.URLOption_detailList.substr(0,this.URLOption_detailList.indexOf('/')) getDetailed(val[this.URLOption.mainShowMasterId || this.URLOption.masterId || this.allUrlOption.defalutMasterId || 'masterId'], _showMasterUrl)
this.apiColumns_DetailsTable = this.initTableColumns(this.initApiColumnsForDto(res.details[0],_parentName),'detail_api') ]).then((res) => {
if(this.$refs.currenDrawer_Ref){ let _allRes = JSON.parse(JSON.stringify(res[0]))
this.$refs.currenDrawer_Ref.getDetailList(res,()=>{ _allRes.masterInfo = res[1]
this.inlineDialogCallback() this.initInlineHttpBack(_allRes)
},()=>{ }).catch(()=>{
this.Loading.DrawerLoading = false
})
}
}else{
this.Loading.DrawerLoading = false
}
})
.catch(err=>{
this.Loading.DrawerLoading = false this.Loading.DrawerLoading = false
}) })
}
// 没有主表信息
else{
getDetailed(val.id, _url)
.then(res=>{
this.initInlineHttpBack(res)
})
.catch(err=>{
this.Loading.DrawerLoading = false
})
}
},
// 查看详情获取返回值后处理
initInlineHttpBack(res){
// 打印使用的全部数据存储
this.tableDataDetails = JSON.parse(JSON.stringify(res))
// 数据处理
this.propsData = res
if (res.details) {
// 表头处理
let _parentName = this.URLOption_detailList.substr(0,this.URLOption_detailList.indexOf('/'))
this.apiColumns_DetailsTable = this.initTableColumns(initApiColumnsForDto(res.details[0],_parentName,this),'detail_api')
if(this.$refs.currenDrawer_Ref){
this.$refs.currenDrawer_Ref.getDetailList(res,()=>{
this.inlineDialogCallback()
},()=>{
this.Loading.DrawerLoading = false
})
}
}else{
this.Loading.DrawerLoading = false
}
}, },
// 前端分页处理 // 前端分页处理
// detailListPageFromFE(data){ // detailListPageFromFE(data){

6
PC/UI.WinIn.FasterZ.Inventory/src/mixins/mixins.js

@ -8,6 +8,9 @@ import { getLoginName } from "@/utils/auth"
export const mixins = { export const mixins = {
data() { data() {
return { return {
allUrlOption:allUrlOption,
// 当前路由配置
URLOption:allUrlOption[this.$route.name],
//主表-列表 //主表-列表
URLOption_base:allUrlOption[this.$route.name].baseURL, URLOption_base:allUrlOption[this.$route.name].baseURL,
//主表-明细 //主表-明细
@ -23,7 +26,7 @@ export const mixins = {
//明细-查看主表 //明细-查看主表
URLOption_parent:allUrlOption[this.$route.name].parentURL ? allUrlOption[this.$route.name].parentURL : allUrlOption[this.$route.name].detailURL, URLOption_parent:allUrlOption[this.$route.name].parentURL ? allUrlOption[this.$route.name].parentURL : allUrlOption[this.$route.name].detailURL,
//明细-查看主表的连接id //明细-查看主表的连接id
URLOption_masterId:allUrlOption[this.$route.name].masterId || 'masterId', URLOption_masterId:allUrlOption[this.$route.name].masterId || allUrlOption.defalutMasterId || 'masterId',
//明细-查看主表的连接title名称 //明细-查看主表的连接title名称
URLOption_masterName:allUrlOption[this.$route.name].masterName, URLOption_masterName:allUrlOption[this.$route.name].masterName,
// 列表-明细-查看详情标题名称 // 列表-明细-查看详情标题名称
@ -65,7 +68,6 @@ export const mixins = {
name: "determine" name: "determine"
}, },
], ],
addEditApiType: null,//Api新增编辑方式(add,edit) addEditApiType: null,//Api新增编辑方式(add,edit)
editFromApiRowData:null,//Api编辑方式的默认值 editFromApiRowData:null,//Api编辑方式的默认值
} }

17
PC/UI.WinIn.FasterZ.Inventory/src/utils/baseData/urlOption.js

@ -1,3 +1,6 @@
// 默认配置
export const defalutMasterId = 'masterID'
// 示例数据 // 示例数据
export const TestSchool = { export const TestSchool = {
baseURL:'TestSchool/base',//主表-列表 baseURL:'TestSchool/base',//主表-列表
@ -17,58 +20,70 @@ export const TestSchool = {
export const ExportCustomUserSetting = { export const ExportCustomUserSetting = {
baseURL:'ExportCustomUserSetting/base',//主表-列表 baseURL:'ExportCustomUserSetting/base',//主表-列表
detailURL:'app/export-custom-user-setting',//主表-明细 + 明细-查看主表 detailURL:'app/export-custom-user-setting',//主表-明细 + 明细-查看主表
hasDetail:false,
} }
export const Container = { export const Container = {
baseURL:'Container/base',//主表-列表 baseURL:'Container/base',//主表-列表
detailURL:'app/container',//主表-明细 + 明细-查看主表 detailURL:'app/container',//主表-明细 + 明细-查看主表
detailListURL:'ContainerDetail/base',//明细-列表, detailListURL:'ContainerDetail/base',//明细-列表,
masterId:'masterID',//明细获取主表信息的masterId hasDetail:true,
isMaster:true
} }
export const ContainerDetail = { export const ContainerDetail = {
baseURL:'ContainerDetail/base',//主表-列表 baseURL:'ContainerDetail/base',//主表-列表
detailURL:'app/container-detail',//主表-明细 + 明细-查看主表 detailURL:'app/container-detail',//主表-明细 + 明细-查看主表
hasDetail:true,
isMaster:false
} }
export const ErpInventoryBalance = { export const ErpInventoryBalance = {
baseURL:'ErpInventoryBalance/base',//主表-列表 baseURL:'ErpInventoryBalance/base',//主表-列表
detailURL:'app/erp-inventory-balance',//主表-明细 + 明细-查看主表 detailURL:'app/erp-inventory-balance',//主表-明细 + 明细-查看主表
hasDetail:false,
} }
export const InventoryBalance = { export const InventoryBalance = {
baseURL:'InventoryBalance/base',//主表-列表 baseURL:'InventoryBalance/base',//主表-列表
detailURL:'app/inventory-balance',//主表-明细 + 明细-查看主表 detailURL:'app/inventory-balance',//主表-明细 + 明细-查看主表
hasDetail:false,
} }
export const InventoryOccupied = { export const InventoryOccupied = {
baseURL:'InventoryOccupied/base',//主表-列表 baseURL:'InventoryOccupied/base',//主表-列表
detailURL:'app/inventory-occupied',//主表-明细 + 明细-查看主表 detailURL:'app/inventory-occupied',//主表-明细 + 明细-查看主表
hasDetail:false,
} }
export const InventoryPredictable = { export const InventoryPredictable = {
baseURL:'InventoryPredictable/base',//主表-列表 baseURL:'InventoryPredictable/base',//主表-列表
detailURL:'app/inventory-predictable',//主表-明细 + 明细-查看主表 detailURL:'app/inventory-predictable',//主表-明细 + 明细-查看主表
hasDetail:false,
} }
export const InventorySnapshot = { export const InventorySnapshot = {
baseURL:'InventorySnapshot/base',//主表-列表 baseURL:'InventorySnapshot/base',//主表-列表
detailURL:'app/inventory-snapshot',//主表-明细 + 明细-查看主表 detailURL:'app/inventory-snapshot',//主表-明细 + 明细-查看主表
hasDetail:false,
} }
export const InventoryTransaction = { export const InventoryTransaction = {
baseURL:'InventoryTransaction/base',//主表-列表 baseURL:'InventoryTransaction/base',//主表-列表
detailURL:'app/inventory-transaction',//主表-明细 + 明细-查看主表 detailURL:'app/inventory-transaction',//主表-明细 + 明细-查看主表
hasDetail:false,
} }
export const InventoryTransferLog = { export const InventoryTransferLog = {
baseURL:'InventoryTransferLog/base',//主表-列表 baseURL:'InventoryTransferLog/base',//主表-列表
detailURL:'app/inventory-transfer-log',//主表-明细 + 明细-查看主表 detailURL:'app/inventory-transfer-log',//主表-明细 + 明细-查看主表
hasDetail:false,
} }
export const LocationCapacity = { export const LocationCapacity = {
baseURL:'LocationCapacity/base',//主表-列表 baseURL:'LocationCapacity/base',//主表-列表
detailURL:'app/location-capacity',//主表-明细 + 明细-查看主表 detailURL:'app/location-capacity',//主表-明细 + 明细-查看主表
hasDetail:false,
} }

230
PC/UI.WinIn.FasterZ.Inventory/src/utils/index.js

@ -3,11 +3,12 @@
*/ */
import {fileStorage, getPageList } from '@/api/wms-api' import {fileStorage, getPageList } from '@/api/wms-api'
import store from '@/store' import store from '@/store'
import i18n from "@/lang"
/** /**
* @param {string} url * @param {string} url
* @returns {Object} * @returns {Object}
*/ */
export function getQueryObject(url) { export function getQueryObject(url) {
url = url == null ? window.location.href : url url = url == null ? window.location.href : url
const search = url.substring(url.lastIndexOf('?') + 1) const search = url.substring(url.lastIndexOf('?') + 1)
@ -25,9 +26,9 @@
// 返回utf8字符串的字节长度 // 返回utf8字符串的字节长度
/** /**
* @param {string} input value * @param {string} input value
* @returns {number} output value * @returns {number} output value
*/ */
export function byteLength(str) { export function byteLength(str) {
// returns the byte length of an utf8 string // returns the byte length of an utf8 string
let s = str.length let s = str.length
@ -41,9 +42,9 @@
} }
/** /**
* @param {Array} actual * @param {Array} actual
* @returns {Array} * @returns {Array}
*/ */
export function cleanArray(actual) { export function cleanArray(actual) {
const newArray = [] const newArray = []
for (let i = 0; i < actual.length; i++) { for (let i = 0; i < actual.length; i++) {
@ -55,9 +56,9 @@
} }
/** /**
* @param {Object} json * @param {Object} json
* @returns {Array} * @returns {Array}
*/ */
export function param(json) { export function param(json) {
if (!json) return '' if (!json) return ''
return cleanArray( return cleanArray(
@ -69,9 +70,9 @@
} }
/** /**
* @param {string} url * @param {string} url
* @returns {Object} * @returns {Object}
*/ */
export function param2Obj(url) { export function param2Obj(url) {
const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
if (!search) { if (!search) {
@ -91,9 +92,9 @@
} }
/** /**
* @param {string} val * @param {string} val
* @returns {string} * @returns {string}
*/ */
export function html2Text(val) { export function html2Text(val) {
const div = document.createElement('div') const div = document.createElement('div')
div.innerHTML = val div.innerHTML = val
@ -101,11 +102,11 @@
} }
/** /**
* Merges two objects, giving the last one precedence * Merges two objects, giving the last one precedence
* @param {Object} target * @param {Object} target
* @param {(Object|Array)} source * @param {(Object|Array)} source
* @returns {Object} * @returns {Object}
*/ */
export function objectMerge(target, source) { export function objectMerge(target, source) {
if (typeof target !== 'object') { if (typeof target !== 'object') {
target = {} target = {}
@ -125,9 +126,9 @@
} }
/** /**
* @param {HTMLElement} element * @param {HTMLElement} element
* @param {string} className * @param {string} className
*/ */
// export function toggleClass(element, className) { // export function toggleClass(element, className) {
// if (!element || !className) { // if (!element || !className) {
// return // return
@ -145,11 +146,11 @@
// } // }
/** /**
* @param {Function} func * @param {Function} func
* @param {number} wait * @param {number} wait
* @param {boolean} immediate * @param {boolean} immediate
* @return {*} * @return {*}
*/ */
export function debounce(func, wait, immediate) { export function debounce(func, wait, immediate) {
let timeout, args, context, timestamp, result let timeout, args, context, timestamp, result
// console.log('我在防抖函数里面') // console.log('我在防抖函数里面')
@ -186,12 +187,12 @@
} }
/** /**
* This is just a simple version of deep copy * This is just a simple version of deep copy
* Has a lot of edge cases bug * Has a lot of edge cases bug
* If you want to use a perfect deep copy, use lodash's _.cloneDeep * If you want to use a perfect deep copy, use lodash's _.cloneDeep
* @param {Object} source * @param {Object} source
* @returns {Object} * @returns {Object}
*/ */
export function deepClone(source) { export function deepClone(source) {
if (!source && typeof source !== 'object') { if (!source && typeof source !== 'object') {
throw new Error('error arguments', 'deepClone') throw new Error('error arguments', 'deepClone')
@ -208,16 +209,16 @@
} }
/** /**
* @param {Array} arr * @param {Array} arr
* @returns {Array} * @returns {Array}
*/ */
export function uniqueArr(arr) { export function uniqueArr(arr) {
return Array.from(new Set(arr)) return Array.from(new Set(arr))
} }
/** /**
* @returns {string} * @returns {string}
*/ */
export function createUniqueString() { export function createUniqueString() {
const timestamp = +new Date() + '' const timestamp = +new Date() + ''
const randomNum = parseInt((1 + Math.random()) * 65536) + '' const randomNum = parseInt((1 + Math.random()) * 65536) + ''
@ -225,29 +226,29 @@
} }
/** /**
* Check if an element has a class * Check if an element has a class
* @param {HTMLElement} elm * @param {HTMLElement} elm
* @param {string} cls * @param {string} cls
* @returns {boolean} * @returns {boolean}
*/ */
export function hasClass(ele, cls) { export function hasClass(ele, cls) {
return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')) return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'))
} }
/** /**
* Add class to element * Add class to element
* @param {HTMLElement} elm * @param {HTMLElement} elm
* @param {string} cls * @param {string} cls
*/ */
export function addClass(ele, cls) { export function addClass(ele, cls) {
if (!hasClass(ele, cls)) ele.className += ' ' + cls if (!hasClass(ele, cls)) ele.className += ' ' + cls
} }
/** /**
* Remove class from element * Remove class from element
* @param {HTMLElement} elm * @param {HTMLElement} elm
* @param {string} cls * @param {string} cls
*/ */
export function removeClass(ele, cls) { export function removeClass(ele, cls) {
if (hasClass(ele, cls)) { if (hasClass(ele, cls)) {
const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)') const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)')
@ -274,10 +275,10 @@
// 判断是否存在某个父级元素,层级不定 // 判断是否存在某个父级元素,层级不定
/** /**
* @param {*} obj 当前节点如点击事件返回的e.target * @param {*} obj 当前节点如点击事件返回的e.target
* @param {*} searchName 要查找是否存在的父级节点class * @param {*} searchName 要查找是否存在的父级节点class
* @returns * @returns
*/ */
export function getParentNode(obj,searchName) { export function getParentNode(obj,searchName) {
let node = obj; let node = obj;
let ofDiv = true; let ofDiv = true;
@ -322,11 +323,11 @@
// 匹配正则返回值 // 匹配正则返回值
/** README.md[:currenForm] /** README.md[:currenForm]
* @param {*} type 需要匹配的正则类型 * @param {*} type 需要匹配的正则类型
* @param {*} defaultValue 当前传入值即需要校验值 * @param {*} defaultValue 当前传入值即需要校验值
* @param {*} fixedNum 如果type为pointNumber需要保留小数点后的位数 * @param {*} fixedNum 如果type为pointNumber需要保留小数点后的位数
* @returns * @returns
*/ */
export function getMatchRegConformValue(type,defaultValue,fixedNum){ export function getMatchRegConformValue(type,defaultValue,fixedNum){
let value = defaultValue ? String(defaultValue) : '' let value = defaultValue ? String(defaultValue) : ''
let _conformValue = "" let _conformValue = ""
@ -414,8 +415,8 @@
// faster-new // faster-new
// 转义及读取api接口返回的表头信息 // 转义及读取api接口返回的表头信息
export function zhApiColumnsLable (data,list) { export function zhApiColumnsLable (data,list) {
let _list = list ? list : store.getters.columZHList let _list = list ? list : store.getters.columZHList
return _list ? _list[data] : data return _list ? _list[data] : data
} }
// 首字母转换 type='Lower'(小写,默认) Upper(大写) // 首字母转换 type='Lower'(小写,默认) Upper(大写)
@ -429,3 +430,100 @@
} }
} }
// get-dto-column-type接口表头类型初始化
export function initApiColumnsForDto (list,titleName,that) {
let data = that.$store.getters.dtoColumnTypes
let _coloums = data[titleName].S
let _Columns_Table = []
if(_coloums){
let _data = _coloums.dtoList
_data.forEach(item=>{
// 如果list接口存在数据 ,与list接口返回字段比较处理,list接口存在的话则追加
let _if = firstWordSizeChange(item.name) != 'details'
if(list){
_if = firstWordSizeChange(item.name) in list && firstWordSizeChange(item.name) != 'details'
}
if(_if){
_Columns_Table.push(item)
}
})
}
if(list){
_Columns_Table = _Columns_Table.concat(specialAddColumns(list,titleName))
}
return _Columns_Table
}
// 特殊字段转义处理(api中没有的字段特殊处理)
export function specialAddColumns(list,titleName){
let _apiName = titleName
let _special_list=[]
// creationTime
if('creationTime' in list){
_special_list.push(
{
"name": "CreationTime",
"apiBaseType": "datetime",
"baseApiName": _apiName + 'CreationTime',
"label": zhApiColumnsLable(_apiName + 'CreationTime') || i18n.t('columNames.CreationTime'),
"prop": "creationTime",
}
)
}
// creatorId
if('creatorId' in list){
_special_list.push(
{
"name": "CreatorId",
"apiBaseType": "string",
"baseApiName": _apiName + 'CreatorId',
"label": zhApiColumnsLable(_apiName + 'CreatorId') || i18n.t('columNames.CreatorId'),
"prop": "creatorId",
}
)
}
// lastModificationTime
if('lastModificationTime' in list){
_special_list.push(
{
"name": "LastModificationTime",
"apiBaseType": "datetime",
"baseApiName": _apiName + 'LastModificationTime',
"label": zhApiColumnsLable(_apiName + 'LastModificationTime') || i18n.t('columNames.LastModificationTime'),
"prop": "lastModificationTime",
}
)
}
// lastModifierId
if('lastModifierId' in list){
_special_list.push(
{
"name": "LastModifierId",
"apiBaseType": "string",
"baseApiName": _apiName + 'LastModifierId',
"label": zhApiColumnsLable(_apiName + 'LastModifierId') || i18n.t('columNames.LastModifierId'),
"prop": "lastModifierId",
}
)
}
// tenantId
if('tenantId' in list){
_special_list.push(
{
"name": "TenantId",
"apiBaseType": "string",
"baseApiName": _apiName + 'TenantId',
"label": zhApiColumnsLable(_apiName + 'TenantId') || i18n.t('columNames.TenantId'),
"prop": "tenantId",
}
)
}
return _special_list
}
// 从字段中删除最后某字段
export function sliceStrEndDelete(str,deleteStr){
let _d_l = str.length - deleteStr.length
return str.slice(0,_d_l)
}

24
PC/UI.WinIn.FasterZ.Job/README.md

@ -124,3 +124,27 @@ pointNumberFixed 组合上方validType值仅等于pointNumber时:
小数点后方保留位数,如不填写默认为100位 小数点后方保留位数,如不填写默认为100位
<validType>+<pointNumberFixed>示例: <validType>+<pointNumberFixed>示例:
{ type:"input", label:"金额", prop:"money", validType:'pointNumber',pointNumberFixed:2}, { type:"input", label:"金额", prop:"money", validType:'pointNumber',pointNumberFixed:2},
[urlOpion示例]
// 添加页面需要配置位置
// 示例数据
export const TestSchool = {
baseURL:'TestSchool/base',//主表-列表
detailURL:'app/test-school',//主表-明细 + 明细-查看主表
// detailInfoName:'asnNbr',//主表-明细查看详情的title名称
detailListURL:'TestStudentDetail/base',//明细-列表,
masterId:'masterId',//明细获取主表信息的masterId,默认依次为[默认配置defalutMasterId,固定值masterId]
masterName:'studentName'//明细获取主表信息的title名称
// parentURL:null,//明细-查看主表:特殊接口,如果没有则走detailURL
// deleteURL:null,//删除特殊URL
// addURL:null,//新增特殊URL
// editURL:null,//编辑特殊URL
// exportURL:'exportURL',//导出特殊URL
<!-- 20231124 有主表的子列表 查看详情的主表信息处理 -->
//有主表的子表单页的主表信息接口,默认为当前的[detailURL]去掉[-Detail]
// mainShowMasterUrl:null,
//有主表的子表单页的主表链接参数,默认依次为[默认配置defalutMasterId,上方配置中masterId,固定值masterId]
// mainShowMasterId:'masterId',
//有主表的子表单页的主表路由[用于显示列转义],默认为[当前路由]去掉[Detail]
// masterRoute:null,
}

54
PC/UI.WinIn.FasterZ.Job/src/components/commonTabel-drawer/index.vue

@ -49,6 +49,7 @@
@handleClick="handleClick" @handleClick="handleClick"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 详情 -->
<curren-descriptions <curren-descriptions
border border
v-if="scope.value == 'xq'" v-if="scope.value == 'xq'"
@ -59,6 +60,17 @@
:propsData="propsData" :propsData="propsData"
> >
</curren-descriptions> </curren-descriptions>
<!-- 主表信息 -->
<curren-descriptions
border
v-if="scope.value == 'masterInfo'"
:column="column"
:direction="direction"
:colon="false"
:tabsDesTions="masterColums"
:propsData="propsData.masterInfo"
>
</curren-descriptions>
<!-- 明细 包含分页 头部按钮等 --> <!-- 明细 包含分页 头部按钮等 -->
<tablePagination <tablePagination
ref="tablePaginationForMX_Ref" ref="tablePaginationForMX_Ref"
@ -104,11 +116,12 @@
</template> </template>
</umyTable> </umyTable>
<!-- 自定义扩展 --> <!-- 自定义扩展 -->
<umyTable <!-- <umyTable
v-if=" v-if="
scope.value == zdyValue && scope.value == zdyValue &&
scope.value != 'xq' && scope.value != 'xq' &&
scope.value != 'mx' && scope.value != 'mx' &&
scope.value != 'masterInfo' &&
scope.value != 'hz' && scope.value != 'hz' &&
scope.value != 'zwlcj' scope.value != 'zwlcj'
" "
@ -127,7 +140,7 @@
<template> <template>
<slot></slot> <slot></slot>
</template> </template>
</umyTable> </umyTable> -->
</template> </template>
</curren-tabs> </curren-tabs>
</div> </div>
@ -171,6 +184,10 @@ import pagination from "@/components/Pagination"
import rowDrop from "@/components/rowDrop/index.vue" import rowDrop from "@/components/rowDrop/index.vue"
import * as allUrlOption from '@/utils/baseData/urlOption' import * as allUrlOption from '@/utils/baseData/urlOption'
import { LoadingMixins } from "@/mixins/LoadingMixins"; import { LoadingMixins } from "@/mixins/LoadingMixins";
import {
initApiColumnsForDto,
sliceStrEndDelete
} from '@/utils/index'
export default { export default {
name: 'currenTabel-drawer', name: 'currenTabel-drawer',
components: { components: {
@ -309,7 +326,8 @@ export default {
// tabs // tabs
if (this.dropdownTabsData.length !== 0) { if (this.dropdownTabsData.length !== 0) {
return this.dropdownTabsData return this.dropdownTabsData
} else { }
else {
// //
// if (Object.keys(this.propsData).length != 0) { // if (Object.keys(this.propsData).length != 0) {
if (Object.keys(this.propsData)) { if (Object.keys(this.propsData)) {
@ -317,6 +335,14 @@ export default {
label: "详情", label: "详情",
name: 'xq' name: 'xq'
}] }]
if(this.propsData.masterInfo && this.propsData.masterInfo.length > 0){
this.initDropdownTabsData.push({
label: "主表信息",
name: 'masterInfo'
})
let _master_name = this.URLOption.masterRoute || sliceStrEndDelete(this.$route.name,'Detail')
this.masterColums = initApiColumnsForDto(this.propsData.masterInfo,_master_name,this)
}
// 使 // 使
if(this.propsData.details){ if(this.propsData.details){
this.initDropdownTabsData.push({ this.initDropdownTabsData.push({
@ -343,9 +369,9 @@ export default {
detailHeaderButton:null,//- detailHeaderButton:null,//-
detailInfoTableData:null,//- detailInfoTableData:null,//-
detailInfoTitle:null,//-title detailInfoTitle:null,//-title
otherData:[], // tabs // otherData:[], // tabs
zdyTableColumns:[], // // zdyTableColumns:[], //
zdyValue:'', // // zdyValue:'', //
// firstTabs:'xq', // firstTabs:'xq',
initDropdownTabsData:[ initDropdownTabsData:[
{ {
@ -375,10 +401,14 @@ export default {
MaxResultCount: 20, MaxResultCount: 20,
}, },
totalCountForDetail:0, totalCountForDetail:0,
//-id
URLOption:allUrlOption[this.$route.name],
//-id //-id
URLOption_masterId:allUrlOption[this.$route.name].masterId || 'masterId', URLOption_masterId:allUrlOption[this.$route.name].masterId || allUrlOption.defalutMasterId || 'masterId',
//- //-
URLOption_detailList:allUrlOption[this.$route.name].detailListURL, URLOption_detailList:allUrlOption[this.$route.name].detailListURL,
//
masterColums:null
} }
}, },
methods: { methods: {
@ -574,7 +604,7 @@ export default {
// tabs // tabs
handleClick (val) { handleClick (val) {
this.$emit("currenTabsChange", val);//tab this.$emit("currenTabsChange", val);//tab
this.zdyValue = val.name // this.zdyValue = val.name
this.dropdownTabsData.forEach( item => { this.dropdownTabsData.forEach( item => {
if (item.name == val.name) { if (item.name == val.name) {
let parent = this.$parent let parent = this.$parent
@ -582,12 +612,12 @@ export default {
// //
parent.firstTabs = val.name parent.firstTabs = val.name
if (val.name == 'xq' || val.name == 'mx' || val.name == 'hz') { if (val.name == 'xq' || val.name == 'mx' || val.name == 'hz') {
this.zdyTableColumns = [] // this.zdyTableColumns = []
this.otherData = [] // this.otherData = []
parent.tableLoading = false parent.tableLoading = false
} else { } else {
this.zdyTableColumns = [] // this.zdyTableColumns = []
this.otherData = [] // this.otherData = []
// this.firstTabs = val.name // this.firstTabs = val.name
// tab // tab
// if (item.functionName == 'getListByItemcode') { // if (item.functionName == 'getListByItemcode') {

403
PC/UI.WinIn.FasterZ.Job/src/components/filterForDetailPage/index.vue

@ -120,219 +120,216 @@
</el-table> --> </el-table> -->
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import currenDescriptions from "@/components/currenDescriptions" import currenDescriptions from "@/components/currenDescriptions"
import { tableMixins } from "@/mixins/TableMixins"; import { tableMixins } from "@/mixins/TableMixins";
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins"; import { TableHeaderMixins } from "@/mixins/TableHeaderMixins";
import { LoadingMixins } from "@/mixins/LoadingMixins"; import { LoadingMixins } from "@/mixins/LoadingMixins";
import { mixins } from "@/mixins/mixins"; import { mixins } from "@/mixins/mixins";
import { filterSelectMixins } from '@/mixins/filter-Select' import { filterSelectMixins } from '@/mixins/filter-Select'
import {getListDesById,getPageListForDetail} from "@/api/wms-api" import {getListDesById,getPageListForDetail} from "@/api/wms-api"
export default { import { initApiColumnsForDto } from '@/utils/index'
name: 'filterForDetailPage', export default {
mixins: [ name: 'filterForDetailPage',
tableMixins, mixins: [
TableHeaderMixins, tableMixins,
mixins, TableHeaderMixins,
filterSelectMixins, mixins,
LoadingMixins filterSelectMixins,
], LoadingMixins
components:{ ],
currenDescriptions components:{
}, currenDescriptions
props: { },
// app-main100% props: {
setUTableHeight: { // app-main100%
type: Number, setUTableHeight: {
default: 340
},
//
isShowIndex:{
type: Boolean,
default: false
},
//
tableSelection: {
type: Boolean,
default: false
},
cellStyle: {
type: Function,
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'
// showParentfreshfilterfield
return ['showParent','fresh','filter','field'];
}
},
// 2
column: {
type: Number, type: Number,
default: 2 default: 340
}, },
// //
direction: { isShowIndex:{
type: Boolean,
default: false
},
//
tableSelection: {
type: Boolean,
default: false
},
cellStyle: {
type: Function,
default: () => {
return Function;
}
},
//
showOverflowTooltip:{
type: Boolean,
default: false,
},
// api
DeleteApi: {
type: String, type: String,
default: 'horizontal' default: null
},
rowMaxHeight:{
type:String,
default:'calc(90vh - 450px)'
},
}, },
data () { // -
return { parentColumns:{
dialogShow:true, type: Array,
// URLOption_detailList:allUrlOption[this.$route.name].detailListURL,//- default: null
// URLOption_masterId:allUrlOption[this.$route.name].masterId || 'masterId',//-id },
// URLOption_masterName:allUrlOption[this.$route.name].masterName,//-//-title showHandleButtons:{
// URLOption_parent:allUrlOption[this.$route.name].parentURL ? allUrlOption[this.$route.name].parentURL : allUrlOption[this.$route.name].detailURL,//- type:Array,
currenButtonData: [],// default:() => {
operaButtons:[],// //'add','edit' 'delete'
showParentDialog:false,// // showParentfreshfilterfield
showParentTitle:null,//-title return ['showParent','fresh','filter','field'];
showParentTableData:null,//-
showParentLoading:false,//-
listColumns:[],//
} }
}, },
activated(){ // 2
// column: {
this.dialogShow = false type: Number,
this.$nextTick(() => { default: 2
this.dialogShow = true },
}); //
direction: {
type: String,
default: 'horizontal'
}, },
mounted(){ rowMaxHeight:{
this.paging() type:String,
this.initHandleButtons() default:'calc(90vh - 450px)'
}, },
methods: { },
rowDropForDetail(data,type){ data () {
this.listColumns = data return {
this.$emit("rowDropForDetail", data,type) dialogShow:true,
}, currenButtonData: [],//
// operaButtons:[],//
initHandleButtons(){ showParentDialog:false,//
// showParentTitle:null,//-title
let _arr_header = [] showParentTableData:null,//-
if(this.showHandleButtons.indexOf('add') >= 0){_arr_header.push(this.defaultAddBtn())} showParentLoading:false,//-
if(this.showHandleButtons.indexOf('field') >= 0){_arr_header.push(this.defaultFieldSettingBtn())} listColumns:[],//
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 activated(){
//
this.dialogShow = false
this.$nextTick(() => {
this.dialogShow = true
});
},
mounted(){
this.paging()
this.initHandleButtons()
},
methods: {
rowDropForDetail(data,type){
this.listColumns = data
this.$emit("rowDropForDetail", data,type)
},
//
initHandleButtons(){
//
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 = initApiColumnsForDto(res.items[0],_parentName,this)
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.$message.error("数据获取失败") this.tableData = []
}) res.items.forEach(item=>{
}, item.deleteTipVisible = false
// this.tableData.push(item)
showParentHandleForDetail(data){ })
this.showParentTitle = `${data[this.URLOption_masterName] || ''} 主表信息` this.totalCount = res.totalCount
this.showParentDialog = true }
this.showParentLoading = true this.pagingCallback(callback)
getListDesById(this.URLOption_parent,data[this.URLOption_masterId]) })
.then(res => { .catch(err=>{
this.showParentTableData = res this.Loading.tableLoading = false
this.showParentLoading = false this.$message.error("数据获取失败")
}) })
.catch(err => { },
this.showParentLoading = false //
this.$message.error("主表信息获取失败!") showParentHandleForDetail(data){
}) this.showParentTitle = `${data[this.URLOption_masterName] || ''} 主表信息`
}, this.showParentDialog = true
// this.showParentLoading = true
editHandleForDetail(data){ getListDesById(this.URLOption_parent,data[this.URLOption_masterId])
console.log(data) .then(res => {
}, this.showParentTableData = res
// this.showParentLoading = false
deleteHandleForDetail(data){ })
this.Loading.appMainLoading = true .catch(err => {
data.deleteTipVisible = false this.showParentLoading = false
// interfaceApi[this.DeleteApi](data.id).then(res => { this.$message.error("主表信息获取失败!")
// this.$successMsg('!') })
// this.oldSkipCount = 1 },
// this.Loading.appMainLoading = false //
// this.paging() editHandleForDetail(data){
// }).catch(err => { console.log(data)
// this.Loading.appMainLoading = false },
// this.$message.error("!") //
// }) 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> }
<style lang="scss"> </script>
.filterForDetailPage { <style lang="scss">
.filterForDetailPage {
.mainTable-dialog{ .mainTable-dialog{
.el-dialog{ .el-dialog{
height: calc(100% - 100px); height: calc(100% - 100px);
}
}
.el-dialog__body{
min-height: 200px;
padding-bottom: 20px !important;
} }
}
.filterForDetailPage-list{
height: calc(100%);
overflow: auto;
} }
</style> .el-dialog__body{
min-height: 200px;
padding-bottom: 20px !important;
}
}
.filterForDetailPage-list{
height: calc(100%);
overflow: auto;
}
</style>

184
PC/UI.WinIn.FasterZ.Job/src/mixins/TableMixins.js

@ -1,11 +1,13 @@
import i18n from "@/lang"
import { import {
getPageList, getPageList,
getDetailed, getDetailed,
postDelete, postDelete,
ApiTypeDelete ApiTypeDelete
} from '@/api/wms-api' } from '@/api/wms-api'
import { zhApiColumnsLable,firstWordSizeChange } from '@/utils/index' import {
initApiColumnsForDto,
sliceStrEndDelete
} from '@/utils/index'
export const tableMixins = { export const tableMixins = {
data() { data() {
return { return {
@ -103,9 +105,22 @@ export const tableMixins = {
} }
// 编辑 api // 编辑 api
else if (item.name == "editFromApi") { else if (item.name == "editFromApi") {
this.addEditApiType = 'edit' // this.addEditApiType = 'edit'
this.editFromApiRowData = row // this.editFromApiRowData = row
this.displayDialog.addEditApiDialog = true; // this.displayDialog.addEditApiDialog = true;
let _url = this.URLOption_detail ? this.URLOption_detail : this.URLOption_base
this.Loading.tableLoading = true
getDetailed(row.id, _url)
.then(res=>{
this.addEditApiType = 'edit'
this.editFromApiRowData = res
this.displayDialog.addEditApiDialog = true;
this.Loading.tableLoading = false
})
.catch(err=>{
this.Loading.tableLoading = false
})
} }
// 删除 // 删除
else if (item.name == "delete"){ else if (item.name == "delete"){
@ -158,95 +173,6 @@ export const tableMixins = {
// if(detailsTable && detailsTable[this.$route.name])this.apiColumns_DetailsTable = this.initTableColumns(detailsTable[this.$route.name],'detail_api') // if(detailsTable && detailsTable[this.$route.name])this.apiColumns_DetailsTable = this.initTableColumns(detailsTable[this.$route.name],'detail_api')
// if(detailsPage && detailsPage[this.$route.name])this.apiColumns_DetailsPage = this.initTableColumns(detailsPage[this.$route.name],'detailPage_api') // if(detailsPage && detailsPage[this.$route.name])this.apiColumns_DetailsPage = this.initTableColumns(detailsPage[this.$route.name],'detailPage_api')
// }, // },
// get-dto-column-type接口表头类型初始化
initApiColumnsForDto(list,titleName){
let data = this.$store.getters.dtoColumnTypes
let _coloums = data[titleName].S
let _Columns_Table = []
if(_coloums){
let _data = _coloums.dtoList
_data.forEach(item=>{
// 如果list接口存在数据 ,与list接口返回字段比较处理,list接口存在的话则追加
let _if = firstWordSizeChange(item.name) != 'details'
if(list){
_if = firstWordSizeChange(item.name) in list && firstWordSizeChange(item.name) != 'details'
}
if(_if){
_Columns_Table.push(item)
}
})
}
if(list){
_Columns_Table = _Columns_Table.concat(this.specialAddColumns(list,titleName))
}
return _Columns_Table
},
// 添加特殊字段(api中没有的字段特殊处理)
specialAddColumns(list,titleName){
let _apiName = titleName
let _special_list=[]
// creationTime
if('creationTime' in list){
_special_list.push(
{
"name": "CreationTime",
"apiBaseType": "datetime",
"baseApiName": _apiName + 'CreationTime',
"label": zhApiColumnsLable(_apiName + 'CreationTime') || i18n.t('columNames.CreationTime'),
"prop": "creationTime",
}
)
}
// creatorId
if('creatorId' in list){
_special_list.push(
{
"name": "CreatorId",
"apiBaseType": "string",
"baseApiName": _apiName + 'CreatorId',
"label": zhApiColumnsLable(_apiName + 'CreatorId') || i18n.t('columNames.CreatorId'),
"prop": "creatorId",
}
)
}
// lastModificationTime
if('lastModificationTime' in list){
_special_list.push(
{
"name": "LastModificationTime",
"apiBaseType": "datetime",
"baseApiName": _apiName + 'LastModificationTime',
"label": zhApiColumnsLable(_apiName + 'LastModificationTime') || i18n.t('columNames.LastModificationTime'),
"prop": "lastModificationTime",
}
)
}
// lastModifierId
if('lastModifierId' in list){
_special_list.push(
{
"name": "LastModifierId",
"apiBaseType": "string",
"baseApiName": _apiName + 'LastModifierId',
"label": zhApiColumnsLable(_apiName + 'LastModifierId') || i18n.t('columNames.LastModifierId'),
"prop": "lastModifierId",
}
)
}
// tenantId
if('tenantId' in list){
_special_list.push(
{
"name": "TenantId",
"apiBaseType": "string",
"baseApiName": _apiName + 'TenantId',
"label": zhApiColumnsLable(_apiName + 'TenantId') || i18n.t('columNames.TenantId'),
"prop": "tenantId",
}
)
}
return _special_list
},
//渲染数据 //渲染数据
paging(callback,repeat) { paging(callback,repeat) {
this.Loading.tableLoading = true; this.Loading.tableLoading = true;
@ -255,7 +181,7 @@ export const tableMixins = {
.then(res=>{ .then(res=>{
// 表头处理 // 表头处理
let _list = res.items && res.items.length > 0 ? res.items[0] : null let _list = res.items && res.items.length > 0 ? res.items[0] : null
let _Columns = this.initApiColumnsForDto(_list,this.$route.name) let _Columns = initApiColumnsForDto(_list,this.$route.name,this)
this.apiColumns_Table = this.initTableColumns(_Columns) this.apiColumns_Table = this.initTableColumns(_Columns)
this.apiColumns_DesTions = _Columns this.apiColumns_DesTions = _Columns
// 页面数据处理 // 页面数据处理
@ -312,30 +238,54 @@ export const tableMixins = {
this.Loading.DrawerLoading = true this.Loading.DrawerLoading = true
this.displayDialog.detailsDialog = true; this.displayDialog.detailsDialog = true;
let _url = this.URLOption_detail ? this.URLOption_detail : this.URLOption_base let _url = this.URLOption_detail ? this.URLOption_detail : this.URLOption_base
getDetailed(val.id, _url) // 有主表信息子表(表头处理)
.then(res=>{ if(!this.URLOption.isMaster && this.URLOption.hasDetail){
// 打印使用的全部数据存储 let _showMasterUrl = this.URLOption.mainShowMasterUrl
this.tableDataDetails = JSON.parse(JSON.stringify(res)) if(!this.URLOption.mainShowMasterUrl){
// 数据处理 _showMasterUrl = sliceStrEndDelete(this.URLOption_detail,'-Detail')
this.propsData = res }
if (res.details) { Promise.all([
// 表头处理 getDetailed(val.id, _url),
let _parentName = this.URLOption_detailList.substr(0,this.URLOption_detailList.indexOf('/')) getDetailed(val[this.URLOption.mainShowMasterId || this.URLOption.masterId || this.allUrlOption.defalutMasterId || 'masterId'], _showMasterUrl)
this.apiColumns_DetailsTable = this.initTableColumns(this.initApiColumnsForDto(res.details[0],_parentName),'detail_api') ]).then((res) => {
if(this.$refs.currenDrawer_Ref){ let _allRes = JSON.parse(JSON.stringify(res[0]))
this.$refs.currenDrawer_Ref.getDetailList(res,()=>{ _allRes.masterInfo = res[1]
this.inlineDialogCallback() this.initInlineHttpBack(_allRes)
},()=>{ }).catch(()=>{
this.Loading.DrawerLoading = false
})
}
}else{
this.Loading.DrawerLoading = false
}
})
.catch(err=>{
this.Loading.DrawerLoading = false this.Loading.DrawerLoading = false
}) })
}
// 没有主表信息
else{
getDetailed(val.id, _url)
.then(res=>{
this.initInlineHttpBack(res)
})
.catch(err=>{
this.Loading.DrawerLoading = false
})
}
},
// 查看详情获取返回值后处理
initInlineHttpBack(res){
// 打印使用的全部数据存储
this.tableDataDetails = JSON.parse(JSON.stringify(res))
// 数据处理
this.propsData = res
if (res.details) {
// 表头处理
let _parentName = this.URLOption_detailList.substr(0,this.URLOption_detailList.indexOf('/'))
this.apiColumns_DetailsTable = this.initTableColumns(initApiColumnsForDto(res.details[0],_parentName,this),'detail_api')
if(this.$refs.currenDrawer_Ref){
this.$refs.currenDrawer_Ref.getDetailList(res,()=>{
this.inlineDialogCallback()
},()=>{
this.Loading.DrawerLoading = false
})
}
}else{
this.Loading.DrawerLoading = false
}
}, },
// 前端分页处理 // 前端分页处理
// detailListPageFromFE(data){ // detailListPageFromFE(data){

6
PC/UI.WinIn.FasterZ.Job/src/mixins/mixins.js

@ -8,6 +8,9 @@ import { getLoginName } from "@/utils/auth"
export const mixins = { export const mixins = {
data() { data() {
return { return {
allUrlOption:allUrlOption,
// 当前路由配置
URLOption:allUrlOption[this.$route.name],
//主表-列表 //主表-列表
URLOption_base:allUrlOption[this.$route.name].baseURL, URLOption_base:allUrlOption[this.$route.name].baseURL,
//主表-明细 //主表-明细
@ -23,7 +26,7 @@ export const mixins = {
//明细-查看主表 //明细-查看主表
URLOption_parent:allUrlOption[this.$route.name].parentURL ? allUrlOption[this.$route.name].parentURL : allUrlOption[this.$route.name].detailURL, URLOption_parent:allUrlOption[this.$route.name].parentURL ? allUrlOption[this.$route.name].parentURL : allUrlOption[this.$route.name].detailURL,
//明细-查看主表的连接id //明细-查看主表的连接id
URLOption_masterId:allUrlOption[this.$route.name].masterId || 'masterId', URLOption_masterId:allUrlOption[this.$route.name].masterId || allUrlOption.defalutMasterId || 'masterId',
//明细-查看主表的连接title名称 //明细-查看主表的连接title名称
URLOption_masterName:allUrlOption[this.$route.name].masterName, URLOption_masterName:allUrlOption[this.$route.name].masterName,
// 列表-明细-查看详情标题名称 // 列表-明细-查看详情标题名称
@ -65,7 +68,6 @@ export const mixins = {
name: "determine" name: "determine"
}, },
], ],
addEditApiType: null,//Api新增编辑方式(add,edit) addEditApiType: null,//Api新增编辑方式(add,edit)
editFromApiRowData:null,//Api编辑方式的默认值 editFromApiRowData:null,//Api编辑方式的默认值
} }

56
PC/UI.WinIn.FasterZ.Job/src/utils/baseData/urlOption.js

@ -1,3 +1,6 @@
// 默认配置
export const defalutMasterId = 'masterID'
// 示例数据 // 示例数据
export const TestSchool = { export const TestSchool = {
baseURL:'TestSchool/base',//主表-列表 baseURL:'TestSchool/base',//主表-列表
@ -17,129 +20,162 @@ export const TestSchool = {
export const ExportCustomUserSetting = { export const ExportCustomUserSetting = {
baseURL:'ExportCustomUserSetting/base',//主表-列表 baseURL:'ExportCustomUserSetting/base',//主表-列表
detailURL:'app/export-custom-user-setting',//主表-明细 + 明细-查看主表 detailURL:'app/export-custom-user-setting',//主表-明细 + 明细-查看主表
hasDetail:false,
} }
export const CheckJob = { export const CheckJob = {
baseURL:'CheckJob/base',//主表-列表 baseURL:'CheckJob/base',//主表-列表
detailURL:'app/check-job',//主表-明细 + 明细-查看主表 detailURL:'app/check-job',//主表-明细 + 明细-查看主表
detailListURL:'CheckJobDetail/base',//明细-列表, detailListURL:'CheckJobDetail/base',//明细-列表,
masterId:'masterID',//明细获取主表信息的masterId hasDetail:true,
isMaster:true
} }
export const CheckJobDetail = { export const CheckJobDetail = {
baseURL:'CheckJobDetail/base',//主表-列表 baseURL:'CheckJobDetail/base',//主表-列表
detailURL:'app/check-job-detail',//主表-明细 + 明细-查看主表 detailURL:'app/check-job-detail',//主表-明细 + 明细-查看主表
hasDetail:true,
isMaster:false
} }
export const CountJob = { export const CountJob = {
baseURL:'CountJob/base',//主表-列表 baseURL:'CountJob/base',//主表-列表
detailURL:'app/count-job',//主表-明细 + 明细-查看主表 detailURL:'app/count-job',//主表-明细 + 明细-查看主表
detailListURL:'CountJobDetail/base',//明细-列表, detailListURL:'CountJobDetail/base',//明细-列表,
masterId:'masterID',//明细获取主表信息的masterId hasDetail:true,
isMaster:true
} }
export const CountJobDetail = { export const CountJobDetail = {
baseURL:'CountJobDetail/base',//主表-列表 baseURL:'CountJobDetail/base',//主表-列表
detailURL:'app/count-job-detail',//主表-明细 + 明细-查看主表 detailURL:'app/count-job-detail',//主表-明细 + 明细-查看主表
hasDetail:true,
isMaster:false
} }
export const DeliverJob = { export const DeliverJob = {
baseURL:'DeliverJob/base',//主表-列表 baseURL:'DeliverJob/base',//主表-列表
detailURL:'app/deliver-job',//主表-明细 + 明细-查看主表 detailURL:'app/deliver-job',//主表-明细 + 明细-查看主表
detailListURL:'DeliverJobDetail/base',//明细-列表, detailListURL:'DeliverJobDetail/base',//明细-列表,
masterId:'masterID',//明细获取主表信息的masterId hasDetail:true,
isMaster:true
} }
export const DeliverJobDetail = { export const DeliverJobDetail = {
baseURL:'DeliverJobDetail/base',//主表-列表 baseURL:'DeliverJobDetail/base',//主表-列表
detailURL:'app/deliver-job-detail',//主表-明细 + 明细-查看主表 detailURL:'app/deliver-job-detail',//主表-明细 + 明细-查看主表
hasDetail:true,
isMaster:false
} }
export const InspectJob = { export const InspectJob = {
baseURL:'InspectJob/base',//主表-列表 baseURL:'InspectJob/base',//主表-列表
detailURL:'app/inspect-job',//主表-明细 + 明细-查看主表 detailURL:'app/inspect-job',//主表-明细 + 明细-查看主表
detailListURL:'InspectJobDetail/base',//明细-列表, detailListURL:'InspectJobDetail/base',//明细-列表,
masterId:'masterID',//明细获取主表信息的masterId hasDetail:true,
isMaster:true
} }
export const InspectJobDetail = { export const InspectJobDetail = {
baseURL:'InspectJobDetail/base',//主表-列表 baseURL:'InspectJobDetail/base',//主表-列表
detailURL:'app/inspect-job-detail',//主表-明细 + 明细-查看主表 detailURL:'app/inspect-job-detail',//主表-明细 + 明细-查看主表
hasDetail:true,
isMaster:false
} }
export const InspectJobSummaryDetail = { export const InspectJobSummaryDetail = {
baseURL:'InspectJobSummaryDetail/base',//主表-列表 baseURL:'InspectJobSummaryDetail/base',//主表-列表
detailURL:'app/inspect-job-summary-detail',//主表-明细 + 明细-查看主表 detailURL:'app/inspect-job-summary-detail',//主表-明细 + 明细-查看主表
hasDetail:true,
isMaster:false
} }
export const IssueJob = { export const IssueJob = {
baseURL:'IssueJob/base',//主表-列表 baseURL:'IssueJob/base',//主表-列表
detailURL:'app/issue-job',//主表-明细 + 明细-查看主表 detailURL:'app/issue-job',//主表-明细 + 明细-查看主表
detailListURL:'IssueJobDetail/base',//明细-列表, detailListURL:'IssueJobDetail/base',//明细-列表,
masterId:'masterID',//明细获取主表信息的masterId hasDetail:true,
isMaster:true
} }
export const IssueJobDetail = { export const IssueJobDetail = {
baseURL:'IssueJobDetail/base',//主表-列表 baseURL:'IssueJobDetail/base',//主表-列表
detailURL:'app/issue-job-detail',//主表-明细 + 明细-查看主表 detailURL:'app/issue-job-detail',//主表-明细 + 明细-查看主表
hasDetail:true,
isMaster:false
} }
export const JisDeliverJob = { export const JisDeliverJob = {
baseURL:'JisDeliverJob/base',//主表-列表 baseURL:'JisDeliverJob/base',//主表-列表
detailURL:'app/jis-deliver-job',//主表-明细 + 明细-查看主表 detailURL:'app/jis-deliver-job',//主表-明细 + 明细-查看主表
detailListURL:'JisDeliverJobDetail/base',//明细-列表, detailListURL:'JisDeliverJobDetail/base',//明细-列表,
masterId:'masterID',//明细获取主表信息的masterId hasDetail:true,
isMaster:true
} }
export const JisDeliverJobDetail = { export const JisDeliverJobDetail = {
baseURL:'JisDeliverJobDetail/base',//主表-列表 baseURL:'JisDeliverJobDetail/base',//主表-列表
detailURL:'app/jis-deliver-job-detail',//主表-明细 + 明细-查看主表 detailURL:'app/jis-deliver-job-detail',//主表-明细 + 明细-查看主表
hasDetail:true,
isMaster:false
} }
export const ProductReceiveJob = { export const ProductReceiveJob = {
baseURL:'ProductReceiveJob/base',//主表-列表 baseURL:'ProductReceiveJob/base',//主表-列表
detailURL:'app/product-receive-job',//主表-明细 + 明细-查看主表 detailURL:'app/product-receive-job',//主表-明细 + 明细-查看主表
detailListURL:'ProductReceiveJobDetail/base',//明细-列表, detailListURL:'ProductReceiveJobDetail/base',//明细-列表,
masterId:'masterID',//明细获取主表信息的masterId hasDetail:true,
isMaster:true
} }
export const ProductReceiveJobDetail = { export const ProductReceiveJobDetail = {
baseURL:'ProductReceiveJobDetail/base',//主表-列表 baseURL:'ProductReceiveJobDetail/base',//主表-列表
detailURL:'app/product-receive-job-detail',//主表-明细 + 明细-查看主表 detailURL:'app/product-receive-job-detail',//主表-明细 + 明细-查看主表
hasDetail:true,
isMaster:false
} }
export const PurchaseReceiptJob = { export const PurchaseReceiptJob = {
baseURL:'PurchaseReceiptJob/base',//主表-列表 baseURL:'PurchaseReceiptJob/base',//主表-列表
detailURL:'app/purchase-receipt-job',//主表-明细 + 明细-查看主表 detailURL:'app/purchase-receipt-job',//主表-明细 + 明细-查看主表
detailListURL:'PurchaseReceiptJobDetail/base',//明细-列表, detailListURL:'PurchaseReceiptJobDetail/base',//明细-列表,
masterId:'masterID',//明细获取主表信息的masterId hasDetail:true,
isMaster:true
} }
export const PurchaseReceiptJobDetail = { export const PurchaseReceiptJobDetail = {
baseURL:'PurchaseReceiptJobDetail/base',//主表-列表 baseURL:'PurchaseReceiptJobDetail/base',//主表-列表
detailURL:'app/purchase-receipt-job-detail',//主表-明细 + 明细-查看主表 detailURL:'app/purchase-receipt-job-detail',//主表-明细 + 明细-查看主表
hasDetail:true,
isMaster:false
} }
export const PurchaseReturnJob = { export const PurchaseReturnJob = {
baseURL:'PurchaseReturnJob/base',//主表-列表 baseURL:'PurchaseReturnJob/base',//主表-列表
detailURL:'app/purchase-return-job',//主表-明细 + 明细-查看主表 detailURL:'app/purchase-return-job',//主表-明细 + 明细-查看主表
detailListURL:'PurchaseReturnJobDetail/base',//明细-列表, detailListURL:'PurchaseReturnJobDetail/base',//明细-列表,
masterId:'masterID',//明细获取主表信息的masterId hasDetail:true,
isMaster:true
} }
export const PurchaseReturnJobDetail = { export const PurchaseReturnJobDetail = {
baseURL:'PurchaseReturnJobDetail/base',//主表-列表 baseURL:'PurchaseReturnJobDetail/base',//主表-列表
detailURL:'app/purchase-return-job-detail',//主表-明细 + 明细-查看主表 detailURL:'app/purchase-return-job-detail',//主表-明细 + 明细-查看主表
hasDetail:true,
isMaster:false
} }
export const PutawayJob = { export const PutawayJob = {
baseURL:'PutawayJob/base',//主表-列表 baseURL:'PutawayJob/base',//主表-列表
detailURL:'app/putaway-job',//主表-明细 + 明细-查看主表 detailURL:'app/putaway-job',//主表-明细 + 明细-查看主表
detailListURL:'PutawayJobDetail/base',//明细-列表, detailListURL:'PutawayJobDetail/base',//明细-列表,
masterId:'masterID',//明细获取主表信息的masterId hasDetail:true,
isMaster:true
} }
export const PutawayJobDetail = { export const PutawayJobDetail = {
baseURL:'PutawayJobDetail/base',//主表-列表 baseURL:'PutawayJobDetail/base',//主表-列表
detailURL:'app/putaway-job-detail',//主表-明细 + 明细-查看主表 detailURL:'app/putaway-job-detail',//主表-明细 + 明细-查看主表
hasDetail:true,
isMaster:false
} }

230
PC/UI.WinIn.FasterZ.Job/src/utils/index.js

@ -3,11 +3,12 @@
*/ */
import {fileStorage, getPageList } from '@/api/wms-api' import {fileStorage, getPageList } from '@/api/wms-api'
import store from '@/store' import store from '@/store'
import i18n from "@/lang"
/** /**
* @param {string} url * @param {string} url
* @returns {Object} * @returns {Object}
*/ */
export function getQueryObject(url) { export function getQueryObject(url) {
url = url == null ? window.location.href : url url = url == null ? window.location.href : url
const search = url.substring(url.lastIndexOf('?') + 1) const search = url.substring(url.lastIndexOf('?') + 1)
@ -25,9 +26,9 @@
// 返回utf8字符串的字节长度 // 返回utf8字符串的字节长度
/** /**
* @param {string} input value * @param {string} input value
* @returns {number} output value * @returns {number} output value
*/ */
export function byteLength(str) { export function byteLength(str) {
// returns the byte length of an utf8 string // returns the byte length of an utf8 string
let s = str.length let s = str.length
@ -41,9 +42,9 @@
} }
/** /**
* @param {Array} actual * @param {Array} actual
* @returns {Array} * @returns {Array}
*/ */
export function cleanArray(actual) { export function cleanArray(actual) {
const newArray = [] const newArray = []
for (let i = 0; i < actual.length; i++) { for (let i = 0; i < actual.length; i++) {
@ -55,9 +56,9 @@
} }
/** /**
* @param {Object} json * @param {Object} json
* @returns {Array} * @returns {Array}
*/ */
export function param(json) { export function param(json) {
if (!json) return '' if (!json) return ''
return cleanArray( return cleanArray(
@ -69,9 +70,9 @@
} }
/** /**
* @param {string} url * @param {string} url
* @returns {Object} * @returns {Object}
*/ */
export function param2Obj(url) { export function param2Obj(url) {
const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
if (!search) { if (!search) {
@ -91,9 +92,9 @@
} }
/** /**
* @param {string} val * @param {string} val
* @returns {string} * @returns {string}
*/ */
export function html2Text(val) { export function html2Text(val) {
const div = document.createElement('div') const div = document.createElement('div')
div.innerHTML = val div.innerHTML = val
@ -101,11 +102,11 @@
} }
/** /**
* Merges two objects, giving the last one precedence * Merges two objects, giving the last one precedence
* @param {Object} target * @param {Object} target
* @param {(Object|Array)} source * @param {(Object|Array)} source
* @returns {Object} * @returns {Object}
*/ */
export function objectMerge(target, source) { export function objectMerge(target, source) {
if (typeof target !== 'object') { if (typeof target !== 'object') {
target = {} target = {}
@ -125,9 +126,9 @@
} }
/** /**
* @param {HTMLElement} element * @param {HTMLElement} element
* @param {string} className * @param {string} className
*/ */
// export function toggleClass(element, className) { // export function toggleClass(element, className) {
// if (!element || !className) { // if (!element || !className) {
// return // return
@ -145,11 +146,11 @@
// } // }
/** /**
* @param {Function} func * @param {Function} func
* @param {number} wait * @param {number} wait
* @param {boolean} immediate * @param {boolean} immediate
* @return {*} * @return {*}
*/ */
export function debounce(func, wait, immediate) { export function debounce(func, wait, immediate) {
let timeout, args, context, timestamp, result let timeout, args, context, timestamp, result
// console.log('我在防抖函数里面') // console.log('我在防抖函数里面')
@ -186,12 +187,12 @@
} }
/** /**
* This is just a simple version of deep copy * This is just a simple version of deep copy
* Has a lot of edge cases bug * Has a lot of edge cases bug
* If you want to use a perfect deep copy, use lodash's _.cloneDeep * If you want to use a perfect deep copy, use lodash's _.cloneDeep
* @param {Object} source * @param {Object} source
* @returns {Object} * @returns {Object}
*/ */
export function deepClone(source) { export function deepClone(source) {
if (!source && typeof source !== 'object') { if (!source && typeof source !== 'object') {
throw new Error('error arguments', 'deepClone') throw new Error('error arguments', 'deepClone')
@ -208,16 +209,16 @@
} }
/** /**
* @param {Array} arr * @param {Array} arr
* @returns {Array} * @returns {Array}
*/ */
export function uniqueArr(arr) { export function uniqueArr(arr) {
return Array.from(new Set(arr)) return Array.from(new Set(arr))
} }
/** /**
* @returns {string} * @returns {string}
*/ */
export function createUniqueString() { export function createUniqueString() {
const timestamp = +new Date() + '' const timestamp = +new Date() + ''
const randomNum = parseInt((1 + Math.random()) * 65536) + '' const randomNum = parseInt((1 + Math.random()) * 65536) + ''
@ -225,29 +226,29 @@
} }
/** /**
* Check if an element has a class * Check if an element has a class
* @param {HTMLElement} elm * @param {HTMLElement} elm
* @param {string} cls * @param {string} cls
* @returns {boolean} * @returns {boolean}
*/ */
export function hasClass(ele, cls) { export function hasClass(ele, cls) {
return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')) return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'))
} }
/** /**
* Add class to element * Add class to element
* @param {HTMLElement} elm * @param {HTMLElement} elm
* @param {string} cls * @param {string} cls
*/ */
export function addClass(ele, cls) { export function addClass(ele, cls) {
if (!hasClass(ele, cls)) ele.className += ' ' + cls if (!hasClass(ele, cls)) ele.className += ' ' + cls
} }
/** /**
* Remove class from element * Remove class from element
* @param {HTMLElement} elm * @param {HTMLElement} elm
* @param {string} cls * @param {string} cls
*/ */
export function removeClass(ele, cls) { export function removeClass(ele, cls) {
if (hasClass(ele, cls)) { if (hasClass(ele, cls)) {
const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)') const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)')
@ -274,10 +275,10 @@
// 判断是否存在某个父级元素,层级不定 // 判断是否存在某个父级元素,层级不定
/** /**
* @param {*} obj 当前节点如点击事件返回的e.target * @param {*} obj 当前节点如点击事件返回的e.target
* @param {*} searchName 要查找是否存在的父级节点class * @param {*} searchName 要查找是否存在的父级节点class
* @returns * @returns
*/ */
export function getParentNode(obj,searchName) { export function getParentNode(obj,searchName) {
let node = obj; let node = obj;
let ofDiv = true; let ofDiv = true;
@ -322,11 +323,11 @@
// 匹配正则返回值 // 匹配正则返回值
/** README.md[:currenForm] /** README.md[:currenForm]
* @param {*} type 需要匹配的正则类型 * @param {*} type 需要匹配的正则类型
* @param {*} defaultValue 当前传入值即需要校验值 * @param {*} defaultValue 当前传入值即需要校验值
* @param {*} fixedNum 如果type为pointNumber需要保留小数点后的位数 * @param {*} fixedNum 如果type为pointNumber需要保留小数点后的位数
* @returns * @returns
*/ */
export function getMatchRegConformValue(type,defaultValue,fixedNum){ export function getMatchRegConformValue(type,defaultValue,fixedNum){
let value = defaultValue ? String(defaultValue) : '' let value = defaultValue ? String(defaultValue) : ''
let _conformValue = "" let _conformValue = ""
@ -414,8 +415,8 @@
// faster-new // faster-new
// 转义及读取api接口返回的表头信息 // 转义及读取api接口返回的表头信息
export function zhApiColumnsLable (data,list) { export function zhApiColumnsLable (data,list) {
let _list = list ? list : store.getters.columZHList let _list = list ? list : store.getters.columZHList
return _list ? _list[data] : data return _list ? _list[data] : data
} }
// 首字母转换 type='Lower'(小写,默认) Upper(大写) // 首字母转换 type='Lower'(小写,默认) Upper(大写)
@ -429,3 +430,100 @@
} }
} }
// get-dto-column-type接口表头类型初始化
export function initApiColumnsForDto (list,titleName,that) {
let data = that.$store.getters.dtoColumnTypes
let _coloums = data[titleName].S
let _Columns_Table = []
if(_coloums){
let _data = _coloums.dtoList
_data.forEach(item=>{
// 如果list接口存在数据 ,与list接口返回字段比较处理,list接口存在的话则追加
let _if = firstWordSizeChange(item.name) != 'details'
if(list){
_if = firstWordSizeChange(item.name) in list && firstWordSizeChange(item.name) != 'details'
}
if(_if){
_Columns_Table.push(item)
}
})
}
if(list){
_Columns_Table = _Columns_Table.concat(specialAddColumns(list,titleName))
}
return _Columns_Table
}
// 特殊字段转义处理(api中没有的字段特殊处理)
export function specialAddColumns(list,titleName){
let _apiName = titleName
let _special_list=[]
// creationTime
if('creationTime' in list){
_special_list.push(
{
"name": "CreationTime",
"apiBaseType": "datetime",
"baseApiName": _apiName + 'CreationTime',
"label": zhApiColumnsLable(_apiName + 'CreationTime') || i18n.t('columNames.CreationTime'),
"prop": "creationTime",
}
)
}
// creatorId
if('creatorId' in list){
_special_list.push(
{
"name": "CreatorId",
"apiBaseType": "string",
"baseApiName": _apiName + 'CreatorId',
"label": zhApiColumnsLable(_apiName + 'CreatorId') || i18n.t('columNames.CreatorId'),
"prop": "creatorId",
}
)
}
// lastModificationTime
if('lastModificationTime' in list){
_special_list.push(
{
"name": "LastModificationTime",
"apiBaseType": "datetime",
"baseApiName": _apiName + 'LastModificationTime',
"label": zhApiColumnsLable(_apiName + 'LastModificationTime') || i18n.t('columNames.LastModificationTime'),
"prop": "lastModificationTime",
}
)
}
// lastModifierId
if('lastModifierId' in list){
_special_list.push(
{
"name": "LastModifierId",
"apiBaseType": "string",
"baseApiName": _apiName + 'LastModifierId',
"label": zhApiColumnsLable(_apiName + 'LastModifierId') || i18n.t('columNames.LastModifierId'),
"prop": "lastModifierId",
}
)
}
// tenantId
if('tenantId' in list){
_special_list.push(
{
"name": "TenantId",
"apiBaseType": "string",
"baseApiName": _apiName + 'TenantId',
"label": zhApiColumnsLable(_apiName + 'TenantId') || i18n.t('columNames.TenantId'),
"prop": "tenantId",
}
)
}
return _special_list
}
// 从字段中删除最后某字段
export function sliceStrEndDelete(str,deleteStr){
let _d_l = str.length - deleteStr.length
return str.slice(0,_d_l)
}
Loading…
Cancel
Save