|
|
@@ -1,109 +1,82 @@
|
|
|
<template>
|
|
|
<!-- 仓库信息: 正常 -->
|
|
|
- <div class="warehouse-info-normal">
|
|
|
+ <div class="warehouse-info-normal"
|
|
|
+ :loading="loading">
|
|
|
<filterCustomTable @search="search">
|
|
|
<a-button class="operBtn"
|
|
|
- @click="openAction">新增</a-button>
|
|
|
+ v-for="item in commonBtn"
|
|
|
+ :key="item.lable"
|
|
|
+ @click="item.callback">{{item.lable}}</a-button>
|
|
|
</filterCustomTable>
|
|
|
- <a-table class="topTable"
|
|
|
- :columns="columns"
|
|
|
- :pagination="false"
|
|
|
- rowKey="key"
|
|
|
- :data-source="wareHouseInfos" />
|
|
|
+ <contextMenu :contextMenuList="forDataBtn"
|
|
|
+ :tableList="tableList">
|
|
|
+ <a-table :columns="columns"
|
|
|
+ class="topTable"
|
|
|
+ :pagination="false"
|
|
|
+ rowKey="key"
|
|
|
+ :data-source="tableList">
|
|
|
+ <template #warehousetype="{ text }">
|
|
|
+ <span>{{ getWareHouseType(text) }}</span>
|
|
|
+ </template>
|
|
|
+ <template #warehousestatus="{ text }">
|
|
|
+ <span>{{ getWareHouseStatus(text) }}</span>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ </contextMenu>
|
|
|
+ <!-- 新增仓库信息 -->
|
|
|
+ <Add />
|
|
|
+ <!-- 停用仓库信息 -->
|
|
|
+ <Disable />
|
|
|
+ <!-- 仓库信息详情 -->
|
|
|
+ <Detail />
|
|
|
+ <!-- 修改仓息库信 -->
|
|
|
+ <Modify />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { computed, defineComponent, ref } from 'vue';
|
|
|
-
|
|
|
+import { defineComponent } from 'vue';
|
|
|
import { initData } from '@/common/methods';
|
|
|
import filterCustomTable from '@/views/information/warehouse-info/compoments/filterTable/index.vue';
|
|
|
-import { QueryWareHouse } from '@/services/go/ermcp/warehouse-info/index';
|
|
|
-import { ErmcpWareHouseInfo } from '@/services/go/ermcp/warehouse-info/interface';
|
|
|
-import { message } from 'ant-design-vue';
|
|
|
-import { getTableHead } from '@/common/methods/table';
|
|
|
-import { getUserId } from '@/services/bus/account';
|
|
|
-
|
|
|
-// 查询客户资料列表
|
|
|
-function getWarehouseInfoList() {
|
|
|
- interface ColumnType {
|
|
|
- key: string;
|
|
|
- dataIndex: string;
|
|
|
- title: string;
|
|
|
- onFilter?: Function;
|
|
|
- sorter?: Function;
|
|
|
- }
|
|
|
-
|
|
|
- // 仓库数据
|
|
|
- const wareHouseInfos = ref<ErmcpWareHouseInfo[]>([]);
|
|
|
- // 列头
|
|
|
- const columns = ref<ColumnType[]>([]);
|
|
|
- // 过滤
|
|
|
- const filteredInfo = ref();
|
|
|
-
|
|
|
- // 获取表头
|
|
|
- function getColumns() {
|
|
|
- interface ColumnType {
|
|
|
- key: string;
|
|
|
- dataIndex: string;
|
|
|
- title: string;
|
|
|
- filteredValue?: string | null;
|
|
|
- onFilter?: Function;
|
|
|
- sorter?: Function;
|
|
|
- }
|
|
|
- const list = getTableHead('table_pcweb_warehouse');
|
|
|
- console.log('list', list);
|
|
|
-
|
|
|
- const filtered = filteredInfo.value || {};
|
|
|
- columns.value.length = 0;
|
|
|
- list.forEach((e, i) => {
|
|
|
- const { columnfield, columntitle } = e;
|
|
|
- const item: ColumnType = {
|
|
|
- key: String(i),
|
|
|
- dataIndex: columnfield,
|
|
|
- title: columntitle,
|
|
|
- };
|
|
|
- columns.value.push(item);
|
|
|
- });
|
|
|
- console.log('columns', columns);
|
|
|
- }
|
|
|
-
|
|
|
- // 获取仓库信息
|
|
|
- const wareHouseInfoList = ref<ErmcpWareHouseInfo[]>([]);
|
|
|
- function actionQuery() {
|
|
|
- const reqParam = { userid: getUserId(), status: '1' };
|
|
|
- QueryWareHouse(reqParam)
|
|
|
- .then((res) => {
|
|
|
- wareHouseInfos.value = res.map((e, i) => {
|
|
|
- return { ...e, key: String(i) };
|
|
|
- });
|
|
|
- console.log('查询仓库列表', wareHouseInfos);
|
|
|
- })
|
|
|
- .catch((err) => message.error(err));
|
|
|
- }
|
|
|
- // 查询
|
|
|
- function search(value: any) {}
|
|
|
-
|
|
|
- return { wareHouseInfos, actionQuery, columns, getColumns, search };
|
|
|
-}
|
|
|
-
|
|
|
-// 新增
|
|
|
-function add() {
|
|
|
- console.log('add');
|
|
|
-}
|
|
|
+import { getTableList, getWareHouseType, getWareHouseStatus } from '../setup';
|
|
|
+import { getBtnList } from '@/common/setup/contextMenu/index';
|
|
|
+import contextMenu from '@/common/components/contextMenu/index.vue';
|
|
|
+import Add from '../../compoments/add/index.vue';
|
|
|
+import Disable from '../../compoments/disable/index.vue';
|
|
|
+import Detail from '../../compoments/detail/index.vue';
|
|
|
+import Modify from '../../compoments/modify/index.vue';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'warehouse-info-normal',
|
|
|
components: {
|
|
|
+ contextMenu,
|
|
|
filterCustomTable,
|
|
|
+ Add,
|
|
|
+ Disable,
|
|
|
+ Detail,
|
|
|
+ Modify,
|
|
|
},
|
|
|
setup() {
|
|
|
- const { wareHouseInfos, actionQuery, columns, getColumns, search } = getWarehouseInfoList();
|
|
|
+ const { tableList, actionQuery, columns, filteredInfo, getColumns, search, loading } = getTableList();
|
|
|
+ const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal');
|
|
|
+ console.log('forDataBtn', forDataBtn);
|
|
|
+
|
|
|
initData(() => {
|
|
|
- actionQuery();
|
|
|
+ actionQuery('1');
|
|
|
getColumns();
|
|
|
});
|
|
|
- return { wareHouseInfos, add, columns, search };
|
|
|
+
|
|
|
+ return {
|
|
|
+ tableList,
|
|
|
+ filteredInfo,
|
|
|
+ columns,
|
|
|
+ search,
|
|
|
+ loading,
|
|
|
+ commonBtn,
|
|
|
+ forDataBtn,
|
|
|
+ getWareHouseStatus,
|
|
|
+ getWareHouseType,
|
|
|
+ };
|
|
|
},
|
|
|
});
|
|
|
</script>
|
|
|
@@ -113,3 +86,11 @@ export default defineComponent({
|
|
|
}
|
|
|
</style
|
|
|
>;
|
|
|
+
|
|
|
+function getTableList(): {} {
|
|
|
+ throw new Error('Function not implemented.');
|
|
|
+}
|
|
|
+
|
|
|
+function getTableList(): { tableList: any; actionQuery: any; columns: any; filteredInfo: any; getColumns: any; search: any; loading: any; } {
|
|
|
+ throw new Error('Function not implemented.');
|
|
|
+}
|