|
@ -3,9 +3,8 @@ import { |
|
|
getDetailed, |
|
|
getDetailed, |
|
|
postDelete |
|
|
postDelete |
|
|
} from '@/api/wms-api' |
|
|
} from '@/api/wms-api' |
|
|
import { initFromApiColumnsLable,firstWordSizeChange } from '@/utils/index' |
|
|
import { zhApiColumnsLable,firstWordSizeChange } from '@/utils/index' |
|
|
import * as allUrlOption from '@/utils/baseData/urlOption' |
|
|
import * as allUrlOption from '@/utils/baseData/urlOption' |
|
|
import { getDtoColumnType } from '@/api/wms-interface' |
|
|
|
|
|
export const tableMixins = { |
|
|
export const tableMixins = { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
@ -113,25 +112,20 @@ export const tableMixins = { |
|
|
// 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接口表头类型初始化
|
|
|
// get-dto-column-type接口表头类型初始化
|
|
|
initApiColumnsForDto(data,list,titleName){ |
|
|
initApiColumnsForDto(list,titleName){ |
|
|
let _coloums = data.filter(item=>{ |
|
|
let data = this.$store.getters.dtoColumnTypes |
|
|
return item.dtoType == 'S' |
|
|
let _coloums = data[titleName].S |
|
|
}) |
|
|
|
|
|
let _Columns_Table = [] |
|
|
let _Columns_Table = [] |
|
|
if(_coloums && _coloums.length > 0){ |
|
|
if(_coloums){ |
|
|
let _data = _coloums[0].columnsTypes |
|
|
let _data = _coloums.dtoList |
|
|
_data.forEach(item=>{ |
|
|
_data.forEach(item=>{ |
|
|
let _item = { |
|
|
let _item = item |
|
|
label:initFromApiColumnsLable(titleName + item.z_ColumnName) || item.z_ColumnName, |
|
|
_item.label = zhApiColumnsLable(titleName + item.name) || item.name |
|
|
prop:firstWordSizeChange(item.z_ColumnName), |
|
|
_item.prop = firstWordSizeChange(item.name) |
|
|
apiType:item.z_ColumnType, |
|
|
|
|
|
apiBaseType:item.z_ColumnBaseType, |
|
|
|
|
|
apiIsEnum:item.isEnum |
|
|
|
|
|
} |
|
|
|
|
|
// 如果list接口存在数据 ,与list接口返回字段比较处理,list接口存在的话则追加
|
|
|
// 如果list接口存在数据 ,与list接口返回字段比较处理,list接口存在的话则追加
|
|
|
let _if = firstWordSizeChange(item.z_ColumnName) != 'details' |
|
|
let _if = firstWordSizeChange(item.name) != 'details' |
|
|
if(list && list.length > 0){ |
|
|
if(list && list.length > 0){ |
|
|
_if = firstWordSizeChange(item.z_ColumnName) in list && firstWordSizeChange(item.z_ColumnName) != 'details' |
|
|
_if = firstWordSizeChange(item.name) in list && firstWordSizeChange(item.name) != 'details' |
|
|
} |
|
|
} |
|
|
if(_if){ |
|
|
if(_if){ |
|
|
_Columns_Table.push(_item) |
|
|
_Columns_Table.push(_item) |
|
@ -144,25 +138,22 @@ export const tableMixins = { |
|
|
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 |
|
|
Promise.all([ |
|
|
getPageList(this.PageListParams, this.URLOption_base) |
|
|
getDtoColumnType(this.URLOption_base), |
|
|
.then(res=>{ |
|
|
getPageList(this.PageListParams, this.URLOption_base) |
|
|
// 表头处理
|
|
|
]).then((allData) => { |
|
|
let _Columns = this.initApiColumnsForDto(res,this.$route.name) |
|
|
// 表头处理
|
|
|
|
|
|
if(allData[0]){ |
|
|
|
|
|
let _Columns = this.initApiColumnsForDto(allData[0],allData[1].items[0] ,this.$route.name) |
|
|
|
|
|
this.apiColumns_Table = this.initTableColumns(_Columns) |
|
|
this.apiColumns_Table = this.initTableColumns(_Columns) |
|
|
this.apiColumns_DesTions = _Columns |
|
|
this.apiColumns_DesTions = _Columns |
|
|
} |
|
|
// 页面数据处理
|
|
|
// 页面数据处理
|
|
|
if(res){ |
|
|
if(allData[1]){ |
|
|
this.tableData = res.items |
|
|
this.tableData = allData[1].items |
|
|
this.totalCount = res.totalCount |
|
|
this.totalCount = allData[1].totalCount |
|
|
} |
|
|
} |
|
|
this.pagingCallback(callback) |
|
|
this.pagingCallback(callback) |
|
|
}) |
|
|
}).catch((err)=>{ |
|
|
.catch(err=>{ |
|
|
this.Loading.tableLoading = false |
|
|
this.Loading.tableLoading = false |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
//接受排序信息并改变视图
|
|
|
//接受排序信息并改变视图
|
|
|
sortChange(val) { |
|
|
sortChange(val) { |
|
@ -202,19 +193,11 @@ 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 |
|
|
Promise.all([ |
|
|
getDetailed(val.id, _url) |
|
|
getDtoColumnType(this.URLOption_detailList), |
|
|
.then(res=>{ |
|
|
getDetailed(val.id, _url) |
|
|
// 表头处理
|
|
|
]).then((allData) => { |
|
|
|
|
|
// 表头处理
|
|
|
|
|
|
if(allData[0]){ |
|
|
|
|
|
let _parentName = this.URLOption_detailList.substr(0,this.URLOption_detailList.indexOf('/')) |
|
|
let _parentName = this.URLOption_detailList.substr(0,this.URLOption_detailList.indexOf('/')) |
|
|
this.initApiColumnsForDto(allData[0],allData[1].details[0],_parentName) |
|
|
this.apiColumns_DetailsTable = this.initTableColumns(this.initApiColumnsForDto(res.details[0],_parentName)) |
|
|
this.apiColumns_DetailsTable = this.initTableColumns(this.initApiColumnsForDto(allData[0],allData[1].details[0],_parentName)) |
|
|
|
|
|
} |
|
|
|
|
|
// 页面数据处理
|
|
|
|
|
|
if(allData[1]){ |
|
|
|
|
|
let res = allData[1] |
|
|
|
|
|
// 打印使用的全部数据存储
|
|
|
// 打印使用的全部数据存储
|
|
|
this.tableDataDetails = JSON.parse(JSON.stringify(res)) |
|
|
this.tableDataDetails = JSON.parse(JSON.stringify(res)) |
|
|
this.propsData = res |
|
|
this.propsData = res |
|
@ -229,10 +212,10 @@ export const tableMixins = { |
|
|
}else{ |
|
|
}else{ |
|
|
this.Loading.DrawerLoading = false |
|
|
this.Loading.DrawerLoading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}).catch(()=>{ |
|
|
.catch(err=>{ |
|
|
this.Loading.DrawerLoading = false |
|
|
this.Loading.DrawerLoading = false |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 前端分页处理
|
|
|
// 前端分页处理
|
|
|
// detailListPageFromFE(data){
|
|
|
// detailListPageFromFE(data){
|
|
|