|
@@ -1,6 +1,10 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div>
|
|
<div>
|
|
|
- <equipment-search @search="reload" ref="search" />
|
|
|
|
|
|
|
+ <equipment-search
|
|
|
|
|
+ @search="reload"
|
|
|
|
|
+ :networkCounts="networkCounts"
|
|
|
|
|
+ ref="search"
|
|
|
|
|
+ />
|
|
|
<!-- 数据表格 -->
|
|
<!-- 数据表格 -->
|
|
|
<ele-pro-table
|
|
<ele-pro-table
|
|
|
ref="table"
|
|
ref="table"
|
|
@@ -10,6 +14,8 @@
|
|
|
full-height="calc(100vh - 116px - 102px)"
|
|
full-height="calc(100vh - 116px - 102px)"
|
|
|
tool-class="ele-toolbar-form"
|
|
tool-class="ele-toolbar-form"
|
|
|
cache-key="systemOrgUserTable"
|
|
cache-key="systemOrgUserTable"
|
|
|
|
|
+ @select="selectChange"
|
|
|
|
|
+ @select-all="changeSelectAll"
|
|
|
>
|
|
>
|
|
|
<!-- 表头工具栏 -->
|
|
<!-- 表头工具栏 -->
|
|
|
<template v-slot:toolbar>
|
|
<template v-slot:toolbar>
|
|
@@ -24,13 +30,36 @@
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
size="small"
|
|
size="small"
|
|
|
- type="primary"
|
|
|
|
|
icon="el-icon-download"
|
|
icon="el-icon-download"
|
|
|
class="ele-btn-icon"
|
|
class="ele-btn-icon"
|
|
|
@click="exportFile"
|
|
@click="exportFile"
|
|
|
>
|
|
>
|
|
|
导出
|
|
导出
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ :disabled="isCheckout"
|
|
|
|
|
+ icon="el-icon-set-up"
|
|
|
|
|
+ class="ele-btn-icon"
|
|
|
|
|
+ >
|
|
|
|
|
+ 打印条码
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ :disabled="isCheckout"
|
|
|
|
|
+ icon="el-icon-thumb"
|
|
|
|
|
+ class="ele-btn-icon"
|
|
|
|
|
+ >
|
|
|
|
|
+ 设置片区负责人
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button size="small" class="ele-btn-icon">删除</el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ @click="moveTo(checkRadioData)"
|
|
|
|
|
+ :disabled="isCheckout"
|
|
|
|
|
+ class="ele-btn-icon"
|
|
|
|
|
+ >移动到</el-button
|
|
|
|
|
+ >
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 编码列 -->
|
|
<!-- 编码列 -->
|
|
|
<template v-slot:code="{ row }">
|
|
<template v-slot:code="{ row }">
|
|
@@ -50,26 +79,50 @@
|
|
|
</el-link>
|
|
</el-link>
|
|
|
</template>
|
|
</template>
|
|
|
</ele-pro-table>
|
|
</ele-pro-table>
|
|
|
|
|
+ <DialogMoveto ref="movetoRef" @success="sucesstion" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+ import { getToken, setToken } from '@/utils/token-util';
|
|
|
import EquipmentSearch from './equipment-search.vue';
|
|
import EquipmentSearch from './equipment-search.vue';
|
|
|
- import { getAssetList, downloadAsset } from '@/api/ledgerAssets';
|
|
|
|
|
|
|
+ import DialogMoveto from './DialogMoveTo.vue';
|
|
|
|
|
+ import {
|
|
|
|
|
+ getAssetList,
|
|
|
|
|
+ downloadAsset,
|
|
|
|
|
+ getNetworkCount
|
|
|
|
|
+ } from '@/api/ledgerAssets';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
|
|
+ import axios from 'axios';
|
|
|
|
|
+ import {
|
|
|
|
|
+ API_BASE_URL,
|
|
|
|
|
+ TOKEN_HEADER_NAME,
|
|
|
|
|
+ LAYOUT_PATH
|
|
|
|
|
+ } from '@/config/setting';
|
|
|
|
|
+ import { download } from '@/utils/file';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
- components: { EquipmentSearch },
|
|
|
|
|
|
|
+ components: { EquipmentSearch, DialogMoveto },
|
|
|
mixins: [dictMixins],
|
|
mixins: [dictMixins],
|
|
|
props: {
|
|
props: {
|
|
|
// 类别id
|
|
// 类别id
|
|
|
categoryId: [Number, String],
|
|
categoryId: [Number, String],
|
|
|
- rootId: [Number, String]
|
|
|
|
|
|
|
+ rootId: [Number, String],
|
|
|
|
|
+ current: {
|
|
|
|
|
+ typeof: Object,
|
|
|
|
|
+ default: {}
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
// 表格列配置
|
|
// 表格列配置
|
|
|
columns: [
|
|
columns: [
|
|
|
|
|
+ {
|
|
|
|
|
+ width: 45,
|
|
|
|
|
+ type: 'selection',
|
|
|
|
|
+ columnKey: 'selection',
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
columnKey: 'index',
|
|
columnKey: 'index',
|
|
|
type: 'index',
|
|
type: 'index',
|
|
@@ -79,12 +132,18 @@
|
|
|
showOverflowTooltip: true,
|
|
showOverflowTooltip: true,
|
|
|
fixed: 'left'
|
|
fixed: 'left'
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'fixCode',
|
|
|
|
|
+ label: '固资编码',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 110
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
columnKey: 'code',
|
|
columnKey: 'code',
|
|
|
slot: 'code',
|
|
slot: 'code',
|
|
|
label: '设备编码',
|
|
label: '设备编码',
|
|
|
showOverflowTooltip: true,
|
|
showOverflowTooltip: true,
|
|
|
- minWidth: 60
|
|
|
|
|
|
|
+ minWidth: 130
|
|
|
},
|
|
},
|
|
|
// {
|
|
// {
|
|
|
// prop: 'code',
|
|
// prop: 'code',
|
|
@@ -99,12 +158,7 @@
|
|
|
showOverflowTooltip: true,
|
|
showOverflowTooltip: true,
|
|
|
minWidth: 110
|
|
minWidth: 110
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- prop: 'fixCode',
|
|
|
|
|
- label: '固资编码',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- minWidth: 110
|
|
|
|
|
- },
|
|
|
|
|
|
|
+
|
|
|
{
|
|
{
|
|
|
prop: 'category.modelType',
|
|
prop: 'category.modelType',
|
|
|
label: '型号',
|
|
label: '型号',
|
|
@@ -118,10 +172,13 @@
|
|
|
minWidth: 110
|
|
minWidth: 110
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- prop: 'detailLocation',
|
|
|
|
|
|
|
+ prop: 'pathName',
|
|
|
label: '位置',
|
|
label: '位置',
|
|
|
showOverflowTooltip: true,
|
|
showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
|
|
|
|
+ minWidth: 110,
|
|
|
|
|
+ formatter: (_row) => {
|
|
|
|
|
+ return _row.position[0].pathName;
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'source',
|
|
prop: 'source',
|
|
@@ -143,15 +200,46 @@
|
|
|
label: '操作',
|
|
label: '操作',
|
|
|
minWidth: 100
|
|
minWidth: 100
|
|
|
}
|
|
}
|
|
|
- ]
|
|
|
|
|
|
|
+ ],
|
|
|
|
|
+ networkCounts: {},
|
|
|
|
|
+ isCheckout: true,
|
|
|
|
|
+ checkRadioData: []
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
this.requestDict('网络状态');
|
|
this.requestDict('网络状态');
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 刷新回调
|
|
|
|
|
+ sucesstion() {
|
|
|
|
|
+ this.reload();
|
|
|
|
|
+ this.isCheckout = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 移动到
|
|
|
|
|
+ moveTo(arr) {
|
|
|
|
|
+ this.$refs.movetoRef.open(arr, this.current);
|
|
|
|
|
+ },
|
|
|
|
|
+ // 全选
|
|
|
|
|
+ changeSelectAll(arr) {
|
|
|
|
|
+ console.log(arr);
|
|
|
|
|
+ if (arr.length != 0) {
|
|
|
|
|
+ this.checkRadioData = arr;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.checkRadioData = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ selectChange(selection, row) {
|
|
|
|
|
+ if (selection.length != 0) {
|
|
|
|
|
+ this.isCheckout = false;
|
|
|
|
|
+ this.checkRadioData = selection;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.isCheckout = true;
|
|
|
|
|
+ this.checkRadioData = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
/* 表格数据源 */
|
|
/* 表格数据源 */
|
|
|
datasource({ page, limit, where, order }) {
|
|
datasource({ page, limit, where, order }) {
|
|
|
|
|
+ this.getNetWork(page, limit, where, order);
|
|
|
return getAssetList({
|
|
return getAssetList({
|
|
|
...where,
|
|
...where,
|
|
|
...order,
|
|
...order,
|
|
@@ -161,6 +249,17 @@
|
|
|
rootCategoryLevelId: this.rootId
|
|
rootCategoryLevelId: this.rootId
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ async getNetWork(page, limit, where, order) {
|
|
|
|
|
+ const res = await getNetworkCount({
|
|
|
|
|
+ ...where,
|
|
|
|
|
+ ...order,
|
|
|
|
|
+ pageNum: page,
|
|
|
|
|
+ size: limit,
|
|
|
|
|
+ categoryLevelId: this.categoryId,
|
|
|
|
|
+ rootCategoryLevelId: this.rootId
|
|
|
|
|
+ });
|
|
|
|
|
+ this.networkCounts = res;
|
|
|
|
|
+ },
|
|
|
/* 刷新表格 */
|
|
/* 刷新表格 */
|
|
|
reload(where) {
|
|
reload(where) {
|
|
|
this.$refs.table.reload({ pageNum: 1, where: where });
|
|
this.$refs.table.reload({ pageNum: 1, where: where });
|
|
@@ -198,7 +297,18 @@
|
|
|
categoryLevelId: this.categoryId,
|
|
categoryLevelId: this.categoryId,
|
|
|
rootCategoryLevelId: this.rootId
|
|
rootCategoryLevelId: this.rootId
|
|
|
};
|
|
};
|
|
|
- downloadAsset(params, '设备台账导出数据');
|
|
|
|
|
|
|
+ // downloadAsset(params, '设备台账导出数据');
|
|
|
|
|
+ axios({
|
|
|
|
|
+ url: `${API_BASE_URL}/main/asset/page/export`,
|
|
|
|
|
+ method: 'post',
|
|
|
|
|
+ responseType: 'blob',
|
|
|
|
|
+ headers: {
|
|
|
|
|
+ Authorization: getToken()
|
|
|
|
|
+ },
|
|
|
|
|
+ data: params
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ download(res.data, '设备台账导出数据');
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|