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