Browse Source

基础数据页面

master
李胜楠 1 year ago
parent
commit
7c3242966b
  1. 402
      src/views/wms/accountcalendar/index.vue
  2. 501
      src/views/wms/location/index.vue

402
src/views/wms/accountcalendar/index.vue

@ -1,312 +1,138 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <Search :schema="Accountcalendar.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="年" prop="year">
<el-input
v-model="queryParams.year"
placeholder="请输入年"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="月" prop="month">
<el-input
v-model="queryParams.month"
placeholder="请输入月"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="描述" prop="descriiption">
<el-input
v-model="queryParams.descriiption"
placeholder="请输入描述"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="开始时间" prop="beginTime">
<el-date-picker
v-model="queryParams.beginTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-date-picker
v-model="queryParams.endTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="转换生效时间" prop="converttotime">
<el-date-picker
v-model="queryParams.converttotime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
v-model="queryParams.remark"
placeholder="请输入备注"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creatorId">
<el-input
v-model="queryParams.creatorId"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
@click="openForm('create')"
v-hasPermi="['wms:accountcalendar:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:accountcalendar:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap> </ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> <Table
<el-table-column label="年" align="center" prop="year" width="150px" /> :columns="Accountcalendar.allSchemas.tableColumns"
<el-table-column label="月" align="center" prop="month" width="150px" /> :data="tableObject.tableList"
<el-table-column label="描述" align="center" prop="descriiption" width="150px" /> :loading="tableObject.loading"
<el-table-column :pagination="{
label="开始时间" total: tableObject.total
align="center" }"
prop="beginTime" v-model:pageSize="tableObject.pageSize"
:formatter="dateFormatter" v-model:currentPage="tableObject.currentPage"
width="150px" v-model:sort="tableObject.sort"
/> >
<el-table-column <template #year="{row}">
label="结束时间" <el-button type="primary" link @click="openDetail(row, '年', row.year)">
align="center" <span>{{ row.year }}</span>
prop="endTime" </el-button>
:formatter="dateFormatter" </template>
width="150px" <template #action="{ row }">
/> <ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
<el-table-column </template>
label="转换生效时间" </Table>
align="center"
prop="converttotime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creatorId" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:accountcalendar:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:accountcalendar:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<AccountcalendarForm ref="formRef" @success="getList" /> <BasicForm
ref="basicFormRef"
@success="getList"
:rules="AccountcalendarRules"
:formAllSchemas="Accountcalendar.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="AccountcalendarApi.updateAccountcalendar"
:apiCreate="AccountcalendarApi.createAccountcalendar"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Accountcalendar.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/accountcalendar/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download' import download from '@/utils/download'
import * as AccountcalendarApi from '@/api/wms/accountcalendar' import * as AccountcalendarApi from '@/api/wms/accountcalendar'
import AccountcalendarForm from './AccountcalendarForm.vue' import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Accountcalendar, AccountcalendarRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Accountcalendar' }) defineOptions({ name: 'Accountcalendar' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const loading = ref(true) // const { tableObject, tableMethods } = useTable({
const total = ref(0) // getListApi: AccountcalendarApi.getAccountcalendarPage //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
year: null,
month: null,
descriiption: null,
beginTime: [],
endTime: [],
converttotime: [],
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creatorId: null
}) })
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */ //
const getList = async () => { const { getList, setSearchParams } = tableMethods
loading.value = true
try { //
const data = await AccountcalendarApi.getAccountcalendarPage(queryParams) const HeadButttondata = [
list.value = data.list defaultButtons.defaultAddBtn({hasPermi:'wms:accountcalendar:create'}), //
total.value = data.total defaultButtons.defaultImportBtn({hasPermi:'wms:accountcalendar:import'}), //
} finally { defaultButtons.defaultExportBtn({hasPermi:'wms:accountcalendar:export'}), //
loading.value = false // defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
} }
} }
/** 搜索按钮操作 */ // -
const handleQuery = () => { const butttondata = [
queryParams.pageNo = 1 defaultButtons.mainListEditBtn({hasPermi:'wms:accountcalendar:update'}), //
getList() defaultButtons.mainListDeleteBtn({hasPermi:'wms:accountcalendar:delete'}), //
} ]
/** 重置按钮操作 */ // -
const resetQuery = () => { const buttonTableClick = async (val, row) => {
queryFormRef.value.resetFields() if (val == 'edit') { //
handleQuery() // const res = await AccountcalendarApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const basicFormRef = ref()
const openForm = (type: string, id?: number) => { const openForm = (type: string, row?: any) => {
formRef.value.open(type, id) basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
@ -323,13 +149,14 @@ const handleDelete = async (id: number) => {
} }
/** 导出按钮操作 */ /** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => { const handleExport = async () => {
try { try {
// //
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const data = await AccountcalendarApi.exportAccountcalendar(queryParams) const data = await AccountcalendarApi.exportAccountcalendar(setSearchParams)
download.excel(data, '账期日历.xls') download.excel(data, '账期日历.xls')
} catch { } catch {
} finally { } finally {
@ -337,6 +164,21 @@ const handleExport = async () => {
} }
} }
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '账期日历导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/ /** 初始化 **/
onMounted(() => { onMounted(() => {
getList() getList()

501
src/views/wms/location/index.vue

@ -1,411 +1,138 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <Search :schema="Location.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="仓库代码" prop="warehouseCode">
<el-input
v-model="queryParams.warehouseCode"
placeholder="请输入仓库代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="区域代码" prop="areaCode">
<el-input
v-model="queryParams.areaCode"
placeholder="请输入区域代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="库位组代码" prop="locationGroupCode">
<el-input
v-model="queryParams.locationGroupCode"
placeholder="请输入库位组代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="ERP库位代码" prop="erpLocationCode">
<el-select
v-model="queryParams.erpLocationCode"
placeholder="请选择ERP库位代码"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ERP_LOCATION)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable class="!w-240px">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.LOCATION_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="巷道" prop="aisle">
<el-input
v-model="queryParams.aisle"
placeholder="请输入巷道"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="货架" prop="shelf">
<el-input
v-model="queryParams.shelf"
placeholder="请输入货架"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="行" prop="locationRow">
<el-input
v-model="queryParams.locationRow"
placeholder="请输入行"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="列" prop="locationColum">
<el-input
v-model="queryParams.locationColum"
placeholder="请输入列"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="拣料优先级" prop="pickPriority">
<el-input
v-model="queryParams.pickPriority"
placeholder="请输入拣料优先级"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="最大承重" prop="maxWeight">
<el-input
v-model="queryParams.maxWeight"
placeholder="请输入最大承重"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="最大面积" prop="maxArea">
<el-input
v-model="queryParams.maxArea"
placeholder="请输入最大面积"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="最大体积" prop="maxVolume">
<el-input
v-model="queryParams.maxVolume"
placeholder="请输入最大体积"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="用户组代码" prop="userGroupCode">
<el-input
v-model="queryParams.userGroupCode"
placeholder="请输入用户组代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
v-model="queryParams.remark"
placeholder="请输入备注"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button type="primary" @click="openForm('create')" v-hasPermi="['wms:location:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:location:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap> </ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> <Table
<el-table-column label="代码" align="center" prop="code" width="150px" /> :columns="Location.allSchemas.tableColumns"
<el-table-column label="名称" align="center" prop="name" width="150px" /> :data="tableObject.tableList"
<el-table-column label="描述" align="center" prop="description" width="150px" /> :loading="tableObject.loading"
<el-table-column label="仓库代码" align="center" prop="warehouseCode" width="150px" /> :pagination="{
<el-table-column label="区域代码" align="center" prop="areaCode" width="150px" /> total: tableObject.total
<el-table-column label="库位组代码" align="center" prop="locationGroupCode" width="150px" /> }"
<el-table-column label="ERP库位代码" align="center" prop="erpLocationCode" width="150px"> v-model:pageSize="tableObject.pageSize"
<template #default="scope"> v-model:currentPage="tableObject.currentPage"
<dict-tag :type="DICT_TYPE.ERP_LOCATION" :value="scope.row.erpLocationCode" /> v-model:sort="tableObject.sort"
</template> >
</el-table-column> <template #code="{row}">
<el-table-column label="类型" align="center" prop="type" width="150px"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<template #default="scope"> <span>{{ row.code }}</span>
<dict-tag :type="DICT_TYPE.LOCATION_TYPE" :value="scope.row.type" /> </el-button>
</template> </template>
</el-table-column> <template #action="{ row }">
<el-table-column label="巷道" align="center" prop="aisle" width="150px" /> <ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
<el-table-column label="货架" align="center" prop="shelf" width="150px" /> </template>
<el-table-column label="行" align="center" prop="locationRow" width="150px" /> </Table>
<el-table-column label="列" align="center" prop="locationColum" width="150px" />
<el-table-column label="拣料优先级" align="center" prop="pickPriority" width="150px" />
<el-table-column label="最大承重" align="center" prop="maxWeight" width="150px" />
<el-table-column label="最大面积" align="center" prop="maxArea" width="150px" />
<el-table-column label="最大体积" align="center" prop="maxVolume" width="150px" />
<el-table-column label="用户组代码" align="center" prop="userGroupCode" width="150px" />
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:location:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:location:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<LocationForm ref="formRef" @success="getList" /> <BasicForm
ref="basicFormRef"
@success="getList"
:rules="LocationRules"
:formAllSchemas="Location.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="LocationApi.updateLocation"
:apiCreate="LocationApi.createLocation"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Location.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/location/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download' import download from '@/utils/download'
import * as LocationApi from '@/api/wms/location' import * as LocationApi from '@/api/wms/location'
import LocationForm from './LocationForm.vue' import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Location, LocationRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Location' }) defineOptions({ name: 'Location' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const loading = ref(true) // const { tableObject, tableMethods } = useTable({
const total = ref(0) // getListApi: LocationApi.getLocationPage //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
code: null,
name: null,
description: null,
warehouseCode: null,
areaCode: null,
locationGroupCode: null,
erpLocationCode: null,
type: null,
aisle: null,
shelf: null,
locationRow: null,
locationColum: null,
pickPriority: null,
maxWeight: null,
maxArea: null,
maxVolume: null,
userGroupCode: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
}) })
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */ //
const getList = async () => { const { getList, setSearchParams } = tableMethods
loading.value = true
try { //
const data = await LocationApi.getLocationPage(queryParams) const HeadButttondata = [
list.value = data.list defaultButtons.defaultAddBtn({hasPermi:'wms:location:create'}), //
total.value = data.total defaultButtons.defaultImportBtn({hasPermi:'wms:location:import'}), //
} finally { defaultButtons.defaultExportBtn({hasPermi:'wms:location:export'}), //
loading.value = false // defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
} }
} }
/** 搜索按钮操作 */ // -
const handleQuery = () => { const butttondata = [
queryParams.pageNo = 1 defaultButtons.mainListEditBtn({hasPermi:'wms:location:update'}), //
getList() defaultButtons.mainListDeleteBtn({hasPermi:'wms:location:delete'}), //
} ]
/** 重置按钮操作 */ // -
const resetQuery = () => { const buttonTableClick = async (val, row) => {
queryFormRef.value.resetFields() if (val == 'edit') { //
handleQuery() // const res = await LocationApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const basicFormRef = ref()
const openForm = (type: string, id?: number) => { const openForm = (type: string, row?: any) => {
formRef.value.open(type, id) basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
@ -422,13 +149,14 @@ const handleDelete = async (id: number) => {
} }
/** 导出按钮操作 */ /** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => { const handleExport = async () => {
try { try {
// //
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const data = await LocationApi.exportLocation(queryParams) const data = await LocationApi.exportLocation(setSearchParams)
download.excel(data, '库位.xls') download.excel(data, '库位.xls')
} catch { } catch {
} finally { } finally {
@ -436,6 +164,21 @@ const handleExport = async () => {
} }
} }
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '库位导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/ /** 初始化 **/
onMounted(() => { onMounted(() => {
getList() getList()

Loading…
Cancel
Save