|
@ -3,7 +3,9 @@ import { |
|
|
getDetailed, |
|
|
getDetailed, |
|
|
postDelete |
|
|
postDelete |
|
|
} from '@/api/wms-api' |
|
|
} from '@/api/wms-api' |
|
|
|
|
|
import { initFromApiColumnsLable,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 { |
|
@ -56,7 +58,7 @@ export const tableMixins = { |
|
|
// 获取通过api的表头数据,不可以在初始化处理,因为接口返回问题
|
|
|
// 获取通过api的表头数据,不可以在初始化处理,因为接口返回问题
|
|
|
initApiColumns(table,des,detailsTable,detailsPage){ |
|
|
initApiColumns(table,des,detailsTable,detailsPage){ |
|
|
// 赋值表头数据
|
|
|
// 赋值表头数据
|
|
|
if(table && table[this.$route.name])this.apiColumns_Table = this.initTableColumns(table[this.$route.name]) |
|
|
// if(table && table[this.$route.name])this.apiColumns_Table = this.initTableColumns(table[this.$route.name])
|
|
|
if(des && des[this.$route.name])this.apiColumns_DesTions = des[this.$route.name] |
|
|
if(des && des[this.$route.name])this.apiColumns_DesTions = des[this.$route.name] |
|
|
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') |
|
@ -65,13 +67,47 @@ 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 |
|
|
getPageList(this.PageListParams, this.URLOption_base).then(res => { |
|
|
Promise.all([ |
|
|
this.tableData = res.items |
|
|
getDtoColumnType(this.$route.name), |
|
|
this.totalCount = res.totalCount |
|
|
getPageList(this.PageListParams, this.URLOption_base) |
|
|
|
|
|
]).then((allData) => { |
|
|
|
|
|
// 表头处理
|
|
|
|
|
|
if(allData[0]){ |
|
|
|
|
|
let _coloums = allData[0].filter(item=>{ |
|
|
|
|
|
return item.dtoType == 'S' |
|
|
|
|
|
}) |
|
|
|
|
|
let _Columns_Table = [] |
|
|
|
|
|
if(_coloums && _coloums.length > 0){ |
|
|
|
|
|
let _data = _coloums[0].columnsTypes |
|
|
|
|
|
_data.forEach(item=>{ |
|
|
|
|
|
let _item = { |
|
|
|
|
|
label:initFromApiColumnsLable(this.$route.name + item.z_ColumnName) || item.z_ColumnName, |
|
|
|
|
|
prop:firstWordSizeChange(item.z_ColumnName), |
|
|
|
|
|
apiType:item.z_ColumnType, |
|
|
|
|
|
isEnum:item.isEnum |
|
|
|
|
|
} |
|
|
|
|
|
_Columns_Table.push(_item) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
this.apiColumns_Table = this.initTableColumns(_Columns_Table) |
|
|
|
|
|
} |
|
|
|
|
|
// 页面数据处理
|
|
|
|
|
|
if(allData[1]){ |
|
|
|
|
|
this.tableData = allData[1].items |
|
|
|
|
|
this.totalCount = allData[1].totalCount |
|
|
|
|
|
} |
|
|
this.pagingCallback(callback) |
|
|
this.pagingCallback(callback) |
|
|
}).catch(err => { |
|
|
console.log(111,this.apiColumns_Table,this.tableData) |
|
|
|
|
|
}).catch(()=>{ |
|
|
this.Loading.tableLoading = false |
|
|
this.Loading.tableLoading = false |
|
|
}) |
|
|
}) |
|
|
|
|
|
// getPageList(this.PageListParams, this.URLOption_base).then(res => {
|
|
|
|
|
|
// this.tableData = res.items
|
|
|
|
|
|
// this.totalCount = res.totalCount
|
|
|
|
|
|
// this.pagingCallback(callback)
|
|
|
|
|
|
// }).catch(err => {
|
|
|
|
|
|
// this.Loading.tableLoading = false
|
|
|
|
|
|
// })
|
|
|
}, |
|
|
}, |
|
|
//接受排序信息并改变视图
|
|
|
//接受排序信息并改变视图
|
|
|
sortChange(val) { |
|
|
sortChange(val) { |
|
|