|
@@ -32,7 +32,7 @@
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
-<!-- <a-col :md="6" :sm="24">
|
|
|
+ <!-- <a-col :md="6" :sm="24">
|
|
|
<a-form-item label="选择类型">
|
|
|
<a-select v-model="queryParam.type" placeholder="请选择">
|
|
|
<a-select-option
|
|
@@ -46,7 +46,7 @@
|
|
|
</a-col>-->
|
|
|
<a-col :md="6 || 24" :sm="24">
|
|
|
<span class="table-page-search-submitButtons">
|
|
|
- <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
|
|
+ <a-button type="primary" @click="handleOk">查询</a-button>
|
|
|
<a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
|
|
|
</span>
|
|
|
</a-col>
|
|
@@ -56,7 +56,7 @@
|
|
|
|
|
|
<div class="table-operator">
|
|
|
<a-button v-if="$auth('store-stores-add')" type="primary" icon="plus" @click="$refs.baseModal.base()">新增</a-button>
|
|
|
-<!-- <a-button style="margin-left: 8px" v-if="$auth('store-stores-export')" type="primary" icon="download" @click="doExport">导出</a-button>-->
|
|
|
+ <!-- <a-button style="margin-left: 8px" v-if="$auth('store-stores-export')" type="primary" icon="download" @click="doExport">导出</a-button>-->
|
|
|
<a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('store-stores-del')">
|
|
|
<a-menu slot="overlay">
|
|
|
<a-popconfirm title="删除仓库,将清空仓库所有物资数据?" @confirm="batchDelete()">
|
|
@@ -69,15 +69,12 @@
|
|
|
</a-dropdown>
|
|
|
</div>
|
|
|
|
|
|
- <s-table
|
|
|
+ <a-table
|
|
|
ref="table"
|
|
|
size="default"
|
|
|
rowKey="id"
|
|
|
:columns="columns"
|
|
|
- :data="loadData"
|
|
|
- :alert="options.alert"
|
|
|
- :rowSelection="options.rowSelection"
|
|
|
- showPagination="auto"
|
|
|
+ :data-source="dataSource"
|
|
|
>
|
|
|
<span slot="action" slot-scope="record">
|
|
|
<template>
|
|
@@ -101,7 +98,7 @@
|
|
|
:status="DictCache.COLOR.DELFLAG[text]"
|
|
|
:text="delFlagMap[text]" />
|
|
|
</span>
|
|
|
- </s-table>
|
|
|
+ </a-table>
|
|
|
<!--</a-col>
|
|
|
</a-row>-->
|
|
|
<base-form ref="baseModal" @ok="handleOk"/>
|
|
@@ -114,10 +111,11 @@
|
|
|
import { STable, Ellipsis } from '@/components'
|
|
|
import BaseForm from './modules/BaseForm'
|
|
|
import Detail from './modules/Detail'
|
|
|
-import { getStorePage, deleteStores, fetchStore, exportStore, fetchStoreTree } from '@/api/store/store'
|
|
|
+import { fetchStoreTableTree, deleteStores, fetchStore, exportStore, fetchStoreTree } from '@/api/store/store'
|
|
|
import { queryDept, getDeptsAllByParentId } from '@/api/upms/dept'
|
|
|
import ImportFormAdd from './modules/ImportFormAdd'
|
|
|
import { exportSpareStore } from '@/api/store/sparestore'
|
|
|
+import { fetchSbTypeTableTree } from '@/api/sb/type'
|
|
|
|
|
|
export default {
|
|
|
name: 'StoreList',
|
|
@@ -140,7 +138,7 @@ export default {
|
|
|
queryParam: {
|
|
|
filter: this.filter
|
|
|
},
|
|
|
- storeTreeDate: [],
|
|
|
+ dataSource: [],
|
|
|
expandedKeys: [],
|
|
|
autoExpandParent: true,
|
|
|
// 表头
|
|
@@ -149,55 +147,24 @@ export default {
|
|
|
title: '序号',
|
|
|
dataIndex: 'index',
|
|
|
customRender: (text, record, index) => {
|
|
|
- return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
|
|
|
+ return index + 1
|
|
|
}
|
|
|
},
|
|
|
- // {
|
|
|
- // title: '编码',
|
|
|
- // dataIndex: 'no'
|
|
|
- // },
|
|
|
{
|
|
|
title: '名称',
|
|
|
dataIndex: 'name'
|
|
|
},
|
|
|
{
|
|
|
- title: '等級',
|
|
|
+ title: '等级',
|
|
|
dataIndex: 'level',
|
|
|
customRender: (text, record, index) => {
|
|
|
return this.BaseTool.Object.getField(this.levelMap, text)
|
|
|
}
|
|
|
},
|
|
|
- /* {
|
|
|
- title: '类型',
|
|
|
- dataIndex: 'type',
|
|
|
- customRender: (text, record, index) => {
|
|
|
- return this.BaseTool.Object.getField(this.typeMap, text)
|
|
|
- }
|
|
|
- },*/
|
|
|
- {
|
|
|
- title: '所属仓库',
|
|
|
- dataIndex: 'parentId',
|
|
|
- customRender: (text, record, index) => {
|
|
|
- return record.parentName
|
|
|
- }
|
|
|
- },
|
|
|
- // {
|
|
|
- // title: '备注',
|
|
|
- // dataIndex: 'remark'
|
|
|
- // },
|
|
|
{
|
|
|
title: '排序',
|
|
|
dataIndex: 'sort'
|
|
|
},
|
|
|
- /* {
|
|
|
- title: '是否删除',
|
|
|
- dataIndex: 'delFlag',
|
|
|
- scopedSlots: { customRender: 'delFlag' }
|
|
|
- },*/
|
|
|
- // {
|
|
|
- // title: '创建日期',
|
|
|
- // dataIndex: 'createdTime'
|
|
|
- // },
|
|
|
{
|
|
|
title: '操作',
|
|
|
key: 'action',
|
|
@@ -220,7 +187,7 @@ export default {
|
|
|
dataScope: {
|
|
|
}
|
|
|
}
|
|
|
- return getStorePage(Object.assign(parameter, this.queryParam))
|
|
|
+ return fetchStoreTableTree(Object.assign(parameter, this.queryParam))
|
|
|
.then(res => {
|
|
|
return res.data
|
|
|
})
|
|
@@ -247,7 +214,10 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
tableOption () {
|
|
|
- this.setTree()
|
|
|
+ fetchStoreTableTree()
|
|
|
+ .then(res => {
|
|
|
+ this.dataSource = res.data
|
|
|
+ })
|
|
|
if (!this.optionAlertShow) {
|
|
|
this.options = {
|
|
|
alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
|
|
@@ -271,22 +241,6 @@ export default {
|
|
|
this.optionAlertShow = false
|
|
|
}
|
|
|
},
|
|
|
- setTree (record = {}) {
|
|
|
- fetchStoreTree({ id: record.id }).then(res => {
|
|
|
- this.storeTreeDate = res.data
|
|
|
- })
|
|
|
- queryDept({ nature: this.DictCache.VALUE.SYS_DEPT_NATURE.FEN_GONG_SI }).then(res => {
|
|
|
- this.companyList = res.data
|
|
|
- })
|
|
|
- getDeptsAllByParentId({ deptId: record.useCompany, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU }).then(res => {
|
|
|
- this.projectList = res.data
|
|
|
- })
|
|
|
- },
|
|
|
- handleCompanyChange (value) {
|
|
|
- getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU }).then(res => {
|
|
|
- this.projectList = res.data
|
|
|
- })
|
|
|
- },
|
|
|
batchDelete (id) {
|
|
|
let ids = []
|
|
|
if (this.BaseTool.String.isBlank(id)) {
|
|
@@ -323,7 +277,10 @@ export default {
|
|
|
this.$refs.importModal.base(record.id)
|
|
|
},
|
|
|
handleOk () {
|
|
|
- this.$refs.table.refresh()
|
|
|
+ fetchStoreTableTree()
|
|
|
+ .then(res => {
|
|
|
+ this.dataSource = res.data
|
|
|
+ })
|
|
|
},
|
|
|
onSelectChange (selectedRowKeys, selectedRows) {
|
|
|
this.selectedRowKeys = selectedRowKeys
|
|
@@ -333,7 +290,7 @@ export default {
|
|
|
this.queryParam = {
|
|
|
filter: this.filter
|
|
|
}
|
|
|
- this.$refs.table.refresh(true)
|
|
|
+ this.handleOk()
|
|
|
},
|
|
|
doExport () {
|
|
|
const parameter = {
|
|
@@ -351,16 +308,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
handleEnter () {
|
|
|
- this.$refs.table.refresh(true)
|
|
|
- },
|
|
|
- onSelect: function (selectedKeys, info) {
|
|
|
- this.selectedKeys = selectedKeys
|
|
|
- this.queryParam.parentId = selectedKeys.length > 0 ? selectedKeys[0] : ''
|
|
|
- this.$refs.table.refresh(true)
|
|
|
- },
|
|
|
- onExpand (expandedKeys) {
|
|
|
- this.expandedKeys = expandedKeys
|
|
|
- this.autoExpandParent = false
|
|
|
+ this.handleOk()
|
|
|
},
|
|
|
doExportSpareStore (record) {
|
|
|
if (record == null) {
|