2 changed files with 718 additions and 0 deletions
@ -0,0 +1,717 @@ |
|||||
|
<template> |
||||
|
<div class="mod-config"> |
||||
|
<el-form :inline="true" label-position="top" :model="queryForm"> |
||||
|
<el-form-item label="BU"> |
||||
|
<el-select v-model="queryForm.buNo" placeholder="请选择" clearable style="width: 80px"> |
||||
|
<el-option |
||||
|
v-for = "i in userBuList" |
||||
|
:key = "i.buNo" |
||||
|
:label = "i.buDesc" |
||||
|
:value = "i.buNo"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="配件编码"> |
||||
|
<el-input v-model="queryForm.partNo" clearable style="width: 100px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="配件名称"> |
||||
|
<el-input v-model="queryForm.partDescription" clearable style="width: 150px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="序列号"> |
||||
|
<el-input v-model="queryForm.batchNo" clearable style="width: 100px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="汇总方式"> |
||||
|
<el-select v-model="queryForm.groupType" @change="groupTypeChanged" style="width: 100px"> |
||||
|
<el-option value="0" label="当前核心备件"></el-option> |
||||
|
<el-option value="1" label="未上机备件"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<!-- <el-form-item label="录入日期">--> |
||||
|
<!-- <el-date-picker--> |
||||
|
<!-- style="width: 120px"--> |
||||
|
<!-- v-model="queryForm.startFirstInDate"--> |
||||
|
<!-- type="date"--> |
||||
|
<!-- format="yyyy-MM-dd"--> |
||||
|
<!-- value-format="yyyy-MM-dd"--> |
||||
|
<!-- placeholder="选择日期">--> |
||||
|
<!-- </el-date-picker>--> |
||||
|
<!-- - --> |
||||
|
<!-- <el-date-picker--> |
||||
|
<!-- style="width: 120px"--> |
||||
|
<!-- v-model="queryForm.endFirstInDate"--> |
||||
|
<!-- type="date"--> |
||||
|
<!-- format="yyyy-MM-dd"--> |
||||
|
<!-- value-format="yyyy-MM-dd 23:59:59"--> |
||||
|
<!-- placeholder="选择日期">--> |
||||
|
<!-- </el-date-picker>--> |
||||
|
<!-- </el-form-item>--> |
||||
|
<el-form-item label=" "> |
||||
|
<el-button type="primary" @click="getDataList()">查询</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-form :inline="true" label-position="top" :model="queryForm"> |
||||
|
|
||||
|
</el-form> |
||||
|
|
||||
|
<el-table |
||||
|
v-if="queryForm.groupType === '0'" |
||||
|
:data="dataList" |
||||
|
border |
||||
|
:height="height + 70" |
||||
|
v-loading="dataListLoading" |
||||
|
@selection-change="handleSelectionChange" |
||||
|
:row-style="controlRowStyle" |
||||
|
style="width: 100%;"> |
||||
|
<el-table-column |
||||
|
type="selection" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
width="50"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in arrayColumns" :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-table |
||||
|
v-if="queryForm.groupType === '1'" |
||||
|
:data="dataList" |
||||
|
border |
||||
|
:height="height + 70" |
||||
|
v-loading="dataListLoading" |
||||
|
@selection-change="handleSelectionChange" |
||||
|
:row-style="controlRowStyle" |
||||
|
style="width: 100%;"> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in arrayPart" :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, 100, 500, 1000]"--> |
||||
|
<!-- :page-size="pageSize"--> |
||||
|
<!-- :total="totalPage"--> |
||||
|
<!-- layout="total, sizes, prev, pager, next, jumper">--> |
||||
|
<!-- </el-pagination>--> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getEamWorkOrderCoreComponentsList |
||||
|
} from '@/api/partspare/inventorystock.js' |
||||
|
import { |
||||
|
getWareHouseList, |
||||
|
} from '@/api/partspare/wareHouseEntity.js' |
||||
|
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' |
||||
|
import {getAllBuList}from '@/api/factory/site.js' |
||||
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "../../../api/table"; |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
userBuList: [], |
||||
|
// 是否收藏 |
||||
|
favorite: false, |
||||
|
// 导出 start |
||||
|
exportData: [], |
||||
|
exportName: "库存信息" + this.dayjs().format('YYYYMMDDHHmmss'), |
||||
|
exportHeader: ["库存信息"], |
||||
|
exportFooter: [], |
||||
|
exportList:[], |
||||
|
// 导出 end |
||||
|
queryForm: { |
||||
|
site: '', |
||||
|
limit: 1, |
||||
|
page: '', |
||||
|
partNo: '', |
||||
|
partDescription: '', |
||||
|
spec: '', |
||||
|
batchNo: '', |
||||
|
warehouseId: '', |
||||
|
locationId: '', |
||||
|
startFirstInDate: '', |
||||
|
endFirstInDate: '', |
||||
|
startQtyOnHand: '', |
||||
|
endQtyOnHand: '', |
||||
|
groupType: '0', |
||||
|
active: 'Y', |
||||
|
safetyStock: '', |
||||
|
buNo: '2_03-RFID', |
||||
|
}, |
||||
|
dataList: [], |
||||
|
wareHouseList: [], |
||||
|
pageIndex: 1, |
||||
|
pageSize: 20, |
||||
|
totalPage: 0, |
||||
|
height: 200, |
||||
|
dataListLoading: false, |
||||
|
dataListSelections: [], |
||||
|
addOrUpdateVisible: false, |
||||
|
// 展示列集 |
||||
|
columnList: [], |
||||
|
// 料号汇总 |
||||
|
arrayPart: [ |
||||
|
// { |
||||
|
// userId: this.$store.state.user.name, |
||||
|
// functionId: 200101103, |
||||
|
// serialNumber: '200101103Table1BuDesc', |
||||
|
// tableId: '200101103Table1', |
||||
|
// tableName: '库存信息汇总表', |
||||
|
// columnProp: 'buDesc', |
||||
|
// headerAlign: "center", |
||||
|
// align: "left", |
||||
|
// columnLabel: 'BU', |
||||
|
// columnHidden: false, |
||||
|
// columnImage: false, |
||||
|
// columnSortable: true, |
||||
|
// sortLv: 0, |
||||
|
// status: true, |
||||
|
// fixed: '', |
||||
|
// columnWidth: 80, |
||||
|
// }, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200101103, |
||||
|
serialNumber: '200101103Table1PartNo', |
||||
|
tableId: '200101103Table1', |
||||
|
tableName: '库存信息汇总表', |
||||
|
columnProp: 'partNo', |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: '配件编号', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: true, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200101103, |
||||
|
serialNumber: '200101103Table1PartDescription', |
||||
|
tableId: '200101103Table1', |
||||
|
tableName: '库存信息汇总表', |
||||
|
columnProp: 'partDescription', |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: '名称', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200101103, |
||||
|
serialNumber: '200101103Table1WarehouseId', |
||||
|
tableId: '200101103Table1', |
||||
|
tableName: '库存信息汇总表', |
||||
|
columnProp: 'oldSerialNo', |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: '序列号', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200101103, |
||||
|
serialNumber: '200101103Table1LocationId', |
||||
|
tableId: '200101103Table1', |
||||
|
tableName: '库存信息汇总表', |
||||
|
columnProp: 'locationId', |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: '库位编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200101103, |
||||
|
serialNumber: '200101103Table1InQty', |
||||
|
tableId: '200101103Table1', |
||||
|
tableName: '库存信息汇总表', |
||||
|
columnProp: 'createdDate', |
||||
|
headerAlign: "center", |
||||
|
align: "right", |
||||
|
columnLabel: '到厂时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200101103, |
||||
|
serialNumber: '200101103Table1OutQty', |
||||
|
tableId: '200101103Table1', |
||||
|
tableName: '库存信息汇总表', |
||||
|
columnProp: 'estUseQty', |
||||
|
headerAlign: "center", |
||||
|
align: "right", |
||||
|
columnLabel: '存放寿命', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200101103, |
||||
|
serialNumber: '200101103Table1QtyOnHand', |
||||
|
tableId: '200101103Table1', |
||||
|
tableName: '库存信息汇总表', |
||||
|
columnProp: 'lifespan', |
||||
|
headerAlign: "center", |
||||
|
align: "right", |
||||
|
columnLabel: '是否已到寿命', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200101103, |
||||
|
serialNumber: '200101103Table1MaxStock', |
||||
|
tableId: '200101103Table1', |
||||
|
tableName: '库存信息汇总表', |
||||
|
columnProp: 'supplierName', |
||||
|
headerAlign: "center", |
||||
|
align: "right", |
||||
|
columnLabel: '供应商', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
} |
||||
|
], |
||||
|
// 料号_序号 |
||||
|
arrayColumns: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200101103, |
||||
|
serialNumber: '200101103Table2PartNo', |
||||
|
tableId: '200101103Table2', |
||||
|
tableName: '库存信息序号表', |
||||
|
columnProp: 'partNo', |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: '配件编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: true, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200101103, |
||||
|
serialNumber: '200101103Table2PartDescription', |
||||
|
tableId: '200101103Table2', |
||||
|
tableName: '库存信息序号表', |
||||
|
columnProp: 'partDescription', |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: '名称', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200101103, |
||||
|
serialNumber: '200101103Table2BatchNo', |
||||
|
tableId: '200101103Table2', |
||||
|
tableName: '库存信息序号表', |
||||
|
columnProp: 'newSerialNo', |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: '序列号', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200101103, |
||||
|
serialNumber: '200101103Table2WarehouseId', |
||||
|
tableId: '200101103Table2', |
||||
|
tableName: '库存信息序号表', |
||||
|
columnProp: 'resourceId', |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: '机台编号', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200101103, |
||||
|
serialNumber: '200101103Table2LocationId', |
||||
|
tableId: '200101103Table2', |
||||
|
tableName: '库存信息序号表', |
||||
|
columnProp: 'createdDate', |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: '上机时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200101103, |
||||
|
serialNumber: '200101103Table2Umid', |
||||
|
tableId: '200101103Table2', |
||||
|
tableName: '库存信息序号表', |
||||
|
columnProp: 'workTime', |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: '使用时长(时)', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200101103, |
||||
|
serialNumber: '200101103Table2AveragePrice', |
||||
|
tableId: '200101103Table2', |
||||
|
tableName: '库存信息序号表', |
||||
|
columnProp: 'estUseQty', |
||||
|
headerAlign: "center", |
||||
|
align: "right", |
||||
|
columnLabel: '推荐寿命', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200101103, |
||||
|
serialNumber: '200101103Table2InQty', |
||||
|
tableId: '200101103Table2', |
||||
|
tableName: '库存信息序号表', |
||||
|
columnProp: 'lifespan', |
||||
|
headerAlign: "center", |
||||
|
align: "right", |
||||
|
columnLabel: '是否到寿命', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200101103, |
||||
|
serialNumber: '200101103Table2OutQty', |
||||
|
tableId: '200101103Table2', |
||||
|
tableName: '库存信息序号表', |
||||
|
columnProp: 'createdBy', |
||||
|
headerAlign: "center", |
||||
|
align: "right", |
||||
|
columnLabel: '上机人员', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}] |
||||
|
} |
||||
|
}, |
||||
|
// watch: { |
||||
|
// 'queryForm.groupType': { |
||||
|
// handler(newVal, oldVal) { |
||||
|
// if (this.queryForm.groupType === '0'){ |
||||
|
// this.columnList = this.arrayColumns |
||||
|
// }else { |
||||
|
// this.columnList = this.arrayPart |
||||
|
// } |
||||
|
// }, |
||||
|
// deep: true, |
||||
|
// immediate: true |
||||
|
// } |
||||
|
// }, |
||||
|
activated() { |
||||
|
// this.getDataList() |
||||
|
// this.getWareHouseList() |
||||
|
}, |
||||
|
created() { |
||||
|
// 动态列 |
||||
|
this.getTableUserColumn(this.$route.meta.menuId+'table1',1) |
||||
|
this.getTableUserColumn(this.$route.meta.menuId+'table2',2) |
||||
|
this.getDataList() |
||||
|
this.getWareHouseList() |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.favoriteIsOk() |
||||
|
this. getBu () |
||||
|
this.$nextTick(() => { |
||||
|
this.height = window.innerHeight - 210 |
||||
|
}) |
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
// 获取bu列表 |
||||
|
getBu () { |
||||
|
let tempData = { |
||||
|
username: this.$store.state.user.name, |
||||
|
} |
||||
|
getAllBuList(tempData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.userBuList = data.rows |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 每页数 |
||||
|
sizeChangeHandle (val) { |
||||
|
this.pageSize = val |
||||
|
this.pageIndex = 1 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
|
||||
|
// 当前页 |
||||
|
currentChangeHandle (val) { |
||||
|
this.pageIndex = val |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
groupTypeChanged(){ |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
|
||||
|
// 获取数据列表 |
||||
|
getDataList () { |
||||
|
this.dataListLoading = true |
||||
|
this.queryForm.page = this.pageIndex |
||||
|
this.queryForm.limit = this.pageSize |
||||
|
getEamWorkOrderCoreComponentsList(this.queryForm).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.dataList = data.list |
||||
|
// this.pageIndex = data.page.currPage |
||||
|
// this.pageSize = data.page.pageSize |
||||
|
// this.totalPage = data.page.totalCount |
||||
|
} |
||||
|
this.dataListLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 获取仓库列表 |
||||
|
getWareHouseList () { |
||||
|
let wareHouse = { |
||||
|
username: this.$store.state.user.name, |
||||
|
warehousetype: "备品备件仓", |
||||
|
} |
||||
|
getWareHouseList(wareHouse).then(({data}) =>{ |
||||
|
if (data && data.code === 0) { |
||||
|
this.wareHouseList = data.data |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
handleSelectionChange (val) { |
||||
|
this.dataListSelections = val |
||||
|
}, |
||||
|
|
||||
|
// 控制单行的背景颜色 |
||||
|
controlRowStyle ({row, rowIndex}) { |
||||
|
if (this.queryForm.groupType === '1' && row.lifespan == '是') { |
||||
|
return { 'background-color': '#FFD3D3', cursor: 'pointer' } |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
startDownload () {}, |
||||
|
|
||||
|
finishDownload () {}, |
||||
|
|
||||
|
fields () { |
||||
|
if (this.queryForm.groupType === '0'){ |
||||
|
this.columnList = this.arrayColumns |
||||
|
}else { |
||||
|
this.columnList = this.arrayPart |
||||
|
} |
||||
|
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 |
||||
|
}, |
||||
|
|
||||
|
// 校验用户是否收藏 |
||||
|
favoriteIsOk () { |
||||
|
let userFavorite = { |
||||
|
userId: this.$store.state.user.id, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
userFavoriteList(userFavorite).then(({data}) => { |
||||
|
for (let i = 0; i < data.list.length; i++) { |
||||
|
if(this.$route.meta.menuId === data.list[i].menuId){ |
||||
|
this.favorite = true |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 收藏 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 |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 动态列开始 获取 用户保存的 格式列 |
||||
|
async getTableUserColumn (tableId, columnId) { |
||||
|
let queryTableUser = { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: tableId, |
||||
|
status: true, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
await getTableUserListLanguage(queryTableUser).then(({data}) => { |
||||
|
if (data.rows.length > 0) { |
||||
|
switch (columnId) { |
||||
|
case 1: |
||||
|
this.arrayColumns = data.rows |
||||
|
break; |
||||
|
case 2: |
||||
|
this.arrayPart = data.rows |
||||
|
break; |
||||
|
} |
||||
|
} else { |
||||
|
this.getColumnList(tableId, columnId) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 获取 tableDefault 列 |
||||
|
async getColumnList (tableId, columnId) { |
||||
|
let queryTable= { |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: tableId, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
await getTableDefaultListLanguage(queryTable).then(({data}) => { |
||||
|
if (!data.rows.length === 0) { |
||||
|
switch (columnId) { |
||||
|
case 1: |
||||
|
this.arrayColumns = data.rows |
||||
|
break; |
||||
|
case 2: |
||||
|
this.arrayPart = data.rows |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue