3 changed files with 775 additions and 1 deletions
-
25src/api/warehouse/inventoryStock.js
-
2src/views/common/home.vue
-
749src/views/modules/warehouse/inventoryStock.vue
@ -0,0 +1,25 @@ |
|||
import { createAPI } from "@/utils/httpRequest.js"; |
|||
|
|||
// 获取库存信息列表
|
|||
export const getInventoryStockList = data => createAPI(`warehouse/getInventoryStockManageList`,'POST',data) |
|||
|
|||
// 保存库存信息
|
|||
export const saveInventoryStock = data => createAPI(`warehouse/saveInventoryStock`,'POST',data) |
|||
|
|||
// 删除库存信息
|
|||
export const delInventoryStock = data => createAPI(`warehouse/delInventoryStock`,'POST',data) |
|||
|
|||
// 调整库存
|
|||
export const adjustInventoryStock = data => createAPI(`warehouse/adjustInventoryStock`,'POST',data) |
|||
|
|||
// 库存冻结/解冻
|
|||
export const freezeInventoryStock = data => createAPI(`warehouse/freezeInventoryStock`,'POST',data) |
|||
|
|||
// 库存预留/释放
|
|||
export const reserveInventoryStock = data => createAPI(`warehouse/reserveInventoryStock`,'POST',data) |
|||
|
|||
// 获取库存详细信息
|
|||
export const getInventoryStockDetail = data => createAPI(`warehouse/getInventoryStockDetail`,'POST',data) |
|||
|
|||
// 库存转移
|
|||
export const transferInventoryStock = data => createAPI(`warehouse/transferInventoryStock`,'POST',data) |
|||
@ -0,0 +1,749 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<div> |
|||
<span @click="favoriteFunction()"> |
|||
<icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg> |
|||
</span> |
|||
</div> |
|||
<el-form :inline="true" label-position="top"> |
|||
<el-form-item :label="inputLabel.headerInput.label1"> |
|||
<el-input style="width: 120px;" v-model="queryHeaderData.site"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="inputLabel.headerInput.label2"> |
|||
<el-input style="width: 120px;" v-model="queryHeaderData.warehouseId"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="inputLabel.headerInput.label3"> |
|||
<el-input style="width: 120px;" v-model="queryHeaderData.partNo"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="inputLabel.headerInput.label4"> |
|||
<el-input style="width: 120px;" v-model="queryHeaderData.batchNo"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="inputLabel.headerInput.label5"> |
|||
<el-input style="width: 120px;" v-model="queryHeaderData.locationId"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="inputLabel.headerInput.label6"> |
|||
<el-select v-model="queryHeaderData.freezeFlag" placeholder="请选择" style="width: 120px;"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="item in selectList.select1" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item style="margin-top: 20px;"> |
|||
<el-button @click="getDataList('Y')" type="primary">查询</el-button> |
|||
<download-excel |
|||
:fields="fields()" |
|||
:data="exportData" |
|||
type="xls" |
|||
:name="exportName" |
|||
:header="exportHeader" |
|||
:footer="exportFooter" |
|||
:defaultValue="exportDefaultValue" |
|||
:fetch="createExportData" |
|||
:before-generate="startDownload" |
|||
:before-finish="finishDownload" |
|||
worksheet="导出信息" |
|||
class="el-button el-button--primary el-button--medium"> |
|||
导出 |
|||
</download-excel> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table |
|||
id="inventoryStock" |
|||
:height="height" |
|||
:data="dataList" |
|||
border |
|||
v-loading="dataListLoading" |
|||
style="width: 100%; margin-bottom: 15px;"> |
|||
<el-table-column |
|||
v-for="(item,index) in columnList" :key="index" |
|||
:sortable="item.columnSortable" |
|||
:prop="item.columnProp" |
|||
:header-align="item.headerAlign" |
|||
:show-overflow-tooltip="item.showOverflowTooltip" |
|||
:align="item.align" |
|||
:fixed="item.fixed==''?false:item.fixed" |
|||
:min-width="item.columnWidth" |
|||
:label="item.columnLabel"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span> |
|||
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
|||
style="width: 100px; height: 80px"/></span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<el-pagination |
|||
@size-change="sizeChangeHandle" |
|||
@current-change="currentChangeHandle" |
|||
:current-page="pageIndex" |
|||
:page-sizes="[20, 50, 100]" |
|||
:page-size="pageSize" |
|||
:total="totalPage" |
|||
layout="total, sizes, prev, pager, next, jumper"> |
|||
</el-pagination> |
|||
|
|||
<column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import column from "../common/column"; |
|||
import { |
|||
searchSysLanguagePackList, |
|||
searchSysLanguageParam, |
|||
searchFunctionButtonList, |
|||
saveButtonList, |
|||
searchSysLanguage, |
|||
searchLanguageListByLanguageCode, |
|||
saveSysLanguageOne |
|||
} from "@/api/sysLanguage.js" |
|||
import getLodop from '@/utils/LodopFuncs.js' |
|||
import { |
|||
saveTableDefaultList, |
|||
saveTableUser, |
|||
getTableDefaultListLanguage, |
|||
getTableUserListLanguage, |
|||
removerDefault, |
|||
removerUser |
|||
} from "@/api/table.js" |
|||
import { |
|||
userFavoriteList, |
|||
saveUserFavorite, |
|||
removeUserFavorite, |
|||
} from '@/api/userFavorite.js' |
|||
import { |
|||
getInventoryStockList, |
|||
} from '@/api/warehouse/inventoryStock.js' |
|||
|
|||
export default { |
|||
components: { |
|||
column |
|||
}, |
|||
data() { |
|||
return { |
|||
queryHeaderData: { |
|||
site: this.$store.state.user.site, |
|||
warehouseId: '', |
|||
partNo: '', |
|||
batchNo: '', |
|||
locationId: '', |
|||
freezeFlag: '', |
|||
page: 1, |
|||
size: 20 |
|||
}, |
|||
setUp: { |
|||
saveButton: false, |
|||
}, |
|||
inputLabel: { |
|||
headerInput: { |
|||
label1: '工厂编码', |
|||
label2: '仓库编码', |
|||
label3: '物料编码', |
|||
label4: '批次号', |
|||
label5: '库位编码', |
|||
label6: '冻结状态', |
|||
label7: '库存信息', |
|||
label8: '现有库存', |
|||
label9: '预留库存', |
|||
label10: '生产日期', |
|||
label11: '过期日期', |
|||
label12: '供应商编码', |
|||
label13: '供应商类型', |
|||
}, |
|||
}, |
|||
selectList: { |
|||
select1: [{ |
|||
value: 'N', |
|||
label: '正常' |
|||
}, { |
|||
value: 'Y', |
|||
label: '冻结' |
|||
}], |
|||
}, |
|||
site: this.$store.state.user.site, |
|||
userName: this.$store.state.user.name, |
|||
// table高度 |
|||
height: 450, |
|||
// 是否收藏 |
|||
favorite: false, |
|||
addLanguage: false, |
|||
functionId: this.$route.meta.menuId, |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
value1: true, |
|||
visible: false, |
|||
showDefault: true, |
|||
// 默认table 查询参数 |
|||
queryTable: { |
|||
functionId: this.$route.meta.menuId, |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
languageCode: this.$i18n.locale |
|||
}, |
|||
// 用户table 查询参数 |
|||
queryTableUser: { |
|||
userId: this.$store.state.user.name, |
|||
functionId: this.$route.meta.menuId, |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
status: true, |
|||
languageCode: this.$i18n.locale |
|||
}, |
|||
// 语言词典查询参数 |
|||
querySysLanguageParam: { |
|||
languageCode: this.$i18n.locale |
|||
}, |
|||
// 语言词典集合 |
|||
sysLanguageParams: [], |
|||
// 用户table 配置集合 |
|||
userColumnList: [], |
|||
// 展示列集 |
|||
columnList: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
serialNumber: 'inventoryStock2501Site', |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
tableName: "inventoryStockTable", |
|||
columnProp: "site", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "工厂编码", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100, |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
serialNumber: 'inventoryStock2501WarehouseId', |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
tableName: "inventoryStockTable", |
|||
columnProp: "warehouseId", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "仓库编码", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100, |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
serialNumber: 'inventoryStock2501PartNo', |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
tableName: "inventoryStockTable", |
|||
columnProp: "partNo", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "物料编码", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120, |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
serialNumber: 'inventoryStock2501BatchNo', |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
tableName: "inventoryStockTable", |
|||
columnProp: "batchNo", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "批次号", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120, |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
serialNumber: 'inventoryStock2501LocationId', |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
tableName: "inventoryStockTable", |
|||
columnProp: "locationId", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "库位编码", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120, |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
serialNumber: 'inventoryStock2501QtyOnHand', |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
tableName: "inventoryStockTable", |
|||
columnProp: "qtyOnHand", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "现有库存", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100, |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
serialNumber: 'inventoryStock2501QtyReserved', |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
tableName: "inventoryStockTable", |
|||
columnProp: "qtyReserved", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "预留库存", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100, |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
serialNumber: 'inventoryStock2501InQty', |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
tableName: "inventoryStockTable", |
|||
columnProp: "inQty", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "入库数量", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100, |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
serialNumber: 'inventoryStock2501OutQty', |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
tableName: "inventoryStockTable", |
|||
columnProp: "outQty", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "出库数量", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100, |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
serialNumber: 'inventoryStock2501FreezeFlag', |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
tableName: "inventoryStockTable", |
|||
columnProp: "freezeFlag", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "冻结状态", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80, |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
serialNumber: 'inventoryStock2501FirstInDate', |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
tableName: "inventoryStockTable", |
|||
columnProp: "firstInDate", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "首次入库日期", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120, |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
serialNumber: 'inventoryStock2501LatestInDate', |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
tableName: "inventoryStockTable", |
|||
columnProp: "latestInDate", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "最近入库日期", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120, |
|||
}, |
|||
], |
|||
// 数据集 |
|||
dataList: [], |
|||
queryButton: { |
|||
functionId: this.$route.meta.menuId, |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
languageCode: this.$i18n.locale, |
|||
objectType: 'button' |
|||
}, |
|||
buttons: { |
|||
search: '查询', |
|||
download: '导出', |
|||
settingTable: '设置列表', |
|||
defaultTable: '设置默认配置' |
|||
}, |
|||
// 导出 start |
|||
exportData: [], |
|||
exportName: "库存管理", |
|||
exportHeader: ["库存管理"], |
|||
exportFooter: [], |
|||
exportDefaultValue: "", |
|||
// 导出 end |
|||
buttonList: [ |
|||
{ |
|||
languageValue: '查询', |
|||
objectId: 'search', |
|||
objectType: "button", |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
}, |
|||
{ |
|||
languageValue: '导出', |
|||
objectId: 'download', |
|||
objectType: "button", |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
} |
|||
], |
|||
languageList: [], |
|||
languageColumnList: [], |
|||
languageDataList: [], |
|||
queryLanguage: {}, |
|||
// 数据集条件 |
|||
querySysLanguagePack: { |
|||
functionId: '', |
|||
page: 1, |
|||
limit: 1, |
|||
languageValue: '', |
|||
objectType: '', |
|||
objectId: '' |
|||
}, |
|||
// 分页 |
|||
pageIndex: 1, |
|||
pageSize: 20, |
|||
totalPage: 0, |
|||
dataListLoading: false |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.height = window.innerHeight - 170; |
|||
}) |
|||
}, |
|||
activated() { |
|||
this.getDataList() |
|||
this.getLanguageList() |
|||
}, |
|||
methods: { |
|||
// 校验用户是否收藏 |
|||
favoriteIsOk() { |
|||
let userFavorite = { |
|||
userId: this.$store.state.user.id, |
|||
languageCode: this.$i18n.locale |
|||
} |
|||
userFavoriteList(userFavorite).then(({data}) => { |
|||
let size = data.list.filter(item => item.userId == userFavorite.menuId).length; |
|||
if (size > 0) { |
|||
this.favorite = true |
|||
} else { |
|||
this.favorite = false |
|||
} |
|||
}) |
|||
}, |
|||
// 收藏 OR 取消收藏 |
|||
favoriteFunction() { |
|||
let userFavorite = { |
|||
userId: this.$store.state.user.id, |
|||
functionId: this.$route.meta.menuId, |
|||
} |
|||
if (this.favorite) { |
|||
// 取消收藏 |
|||
this.$confirm(`确定取消收藏`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
removeUserFavorite(userFavorite).then(({data}) => { |
|||
this.$message.success(data.msg) |
|||
this.favorite = false |
|||
}) |
|||
}) |
|||
} else { |
|||
// 收藏 |
|||
saveUserFavorite(userFavorite).then(({data}) => { |
|||
this.$message.success(data.msg) |
|||
this.favorite = true |
|||
}) |
|||
} |
|||
|
|||
}, |
|||
// 保存语言编辑 |
|||
saveLanguageList(val) { |
|||
saveSysLanguageOne(val).then(({data}) => { |
|||
if (data.code == 0) { |
|||
this.$message.success(data.msg) |
|||
} else { |
|||
this.$message.error(data.msg) |
|||
} |
|||
}) |
|||
}, |
|||
// 编辑语言 |
|||
addLanguageFun() { |
|||
if (this.querySysLanguagePack.languageCode) { |
|||
this.addLanguage = true |
|||
this.languageColumnList = [] |
|||
let query = { |
|||
functionId: this.$route.meta.menuId, |
|||
tableId: "common1002", |
|||
languageCode: this.$i18n.locale |
|||
} |
|||
getTableDefaultListLanguage(query).then(({data}) => { |
|||
if (data.rows.length > 0) { |
|||
this.languageColumnList = data.rows |
|||
} |
|||
}) |
|||
this.languageColumnList = this.columnList |
|||
searchLanguageListByLanguageCode(this.querySysLanguagePack).then(({data}) => { |
|||
this.languageDataList = data.rows |
|||
}) |
|||
} else { |
|||
this.$message("请选中一种语言") |
|||
} |
|||
}, |
|||
// 获取多语言列表 |
|||
getLanguageList() { |
|||
searchSysLanguage(this.queryLanguage).then(({data}) => { |
|||
this.languageList = data.rows |
|||
}) |
|||
}, |
|||
// 获取button的词典 |
|||
getFunctionButtonList() { |
|||
searchFunctionButtonList(this.queryButton).then(({data}) => { |
|||
if (data.code == 0) { |
|||
this.buttons = data.data |
|||
} else { |
|||
// saveButtonList(this.buttonList).then(({data}) => { |
|||
// }) |
|||
} |
|||
}) |
|||
}, |
|||
// 获取语言词典 |
|||
getSysLanguageParamList() { |
|||
searchSysLanguageParam(this.querySysLanguageParam).then(({data}) => { |
|||
this.sysLanguageParams = data.rows |
|||
}) |
|||
}, |
|||
// 打开页面设置 |
|||
userSetting() { |
|||
this.visible = true; |
|||
let queryTable = { |
|||
userId: this.$store.state.user.name, |
|||
functionId: this.$route.meta.menuId, |
|||
tableId: this.$route.meta.menuId + 'INVS01', |
|||
languageCode: this.$i18n.locale |
|||
} |
|||
this.$nextTick(() => { |
|||
this.$refs.column.init(queryTable); |
|||
}); |
|||
}, |
|||
// 获取 用户保存的 格式列 |
|||
getTableUserColumn() { |
|||
getTableUserListLanguage(this.queryTableUser).then(({data}) => { |
|||
if (data.rows.length > 0) { |
|||
//this.columnList = [] |
|||
this.columnList = data.rows |
|||
} else { |
|||
this.getColumnList() |
|||
} |
|||
|
|||
}) |
|||
}, |
|||
// 保存 默认配置 列 |
|||
async saveColumnList() { |
|||
// 删除所有的该页面下保存的数据 |
|||
if (this.userColumnList) { |
|||
//删除 user自定义的数据 |
|||
await removerUser(this.queryTable) |
|||
} |
|||
// 删除默认配置 |
|||
await removerDefault(this.queryTable) |
|||
// 保存页面 table属性 |
|||
let sumColumnList = this.columnList; |
|||
sumColumnList = sumColumnList.map(item => { |
|||
return item = { |
|||
tableId: item.tableId, |
|||
tableName: item.tableName, |
|||
columnProp: item.columnProp, |
|||
columnLabel: item.columnLabel, |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: null, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: null |
|||
} |
|||
}) |
|||
|
|||
await saveTableDefaultList(sumColumnList) |
|||
// 保存页面 button label title 属性 |
|||
let buttons = this.buttonList.map(item => { |
|||
return item = { |
|||
functionId: this.$route.meta.menuId, |
|||
languageValue: item.languageValue, |
|||
objectId: item.objectId, |
|||
objectType: item.objectType, |
|||
tableId: item.tableId |
|||
} |
|||
}) |
|||
await saveButtonList(buttons) |
|||
this.getFunctionButtonList() |
|||
this.getColumnList() |
|||
}, |
|||
// 获取 tableDefault 列 |
|||
getColumnList() { |
|||
getTableDefaultListLanguage(this.queryTable).then(({data}) => { |
|||
if (!data.rows.length == 0) { |
|||
// this.showDefault = false |
|||
this.columnList = data.rows |
|||
} else { |
|||
// this.showDefault = true |
|||
} |
|||
}) |
|||
}, |
|||
// 获取数据列表 |
|||
getDataList() { |
|||
this.dataListLoading = true |
|||
getInventoryStockList(this.queryHeaderData).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.dataList = data.page.list |
|||
this.pageIndex = data.page.currPage |
|||
this.pageSize = data.page.pageSize |
|||
this.totalPage = data.page.totalCount |
|||
} else { |
|||
this.dataList = [] |
|||
this.totalPage = 0 |
|||
} |
|||
this.dataListLoading = false |
|||
}) |
|||
}, |
|||
// 每页数 |
|||
sizeChangeHandle(val) { |
|||
this.pageSize = val |
|||
this.pageIndex = 1 |
|||
this.queryHeaderData.page = 1 |
|||
this.queryHeaderData.size = val |
|||
this.getDataList() |
|||
}, |
|||
// 当前页 |
|||
currentChangeHandle(val) { |
|||
this.pageIndex = val |
|||
this.queryHeaderData.page = val |
|||
this.getDataList() |
|||
}, |
|||
// 导出 |
|||
fields() { |
|||
let json = "{" |
|||
this.columnList.forEach((item, index) => { |
|||
if (index == this.columnList.length - 1) { |
|||
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" |
|||
} else { |
|||
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," |
|||
} |
|||
}) |
|||
json += "}" |
|||
let s = eval("(" + json + ")") |
|||
return s |
|||
}, |
|||
createExportData() { |
|||
// 点击导出按钮之后,开始导出数据之前的执行函数,返回值为需要下载的数据 |
|||
// TODO:构造需要下载的数据返回 |
|||
if (this.dataListSelections.length > 0) { |
|||
return this.dataListSelections; |
|||
} |
|||
return this.dataList; |
|||
}, |
|||
startDownload() { |
|||
// this.exportData = this.dataList |
|||
|
|||
}, |
|||
finishDownload() { |
|||
|
|||
} |
|||
}, |
|||
created() { |
|||
this.getTableUserColumn() |
|||
this.getSysLanguageParamList() |
|||
this.getFunctionButtonList() |
|||
this.favoriteIsOk() |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
.wrapper { |
|||
height: calc(100% - 40px); |
|||
} |
|||
|
|||
.sl-input { |
|||
background-color: transparent; |
|||
border: 0 !important; |
|||
font-size: 12px !important; |
|||
height: 12px !important; |
|||
line-height: 14px !important; |
|||
background-color: transparent !important; |
|||
width: 140px; |
|||
} |
|||
|
|||
.sl-input:focus, textarea:focus { |
|||
|
|||
outline: none; |
|||
|
|||
} |
|||
|
|||
.sl-svg { |
|||
overflow: hidden; |
|||
float: right; |
|||
} |
|||
|
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue