|
|
@ -1,7 +1,8 @@ |
|
|
|
<template> |
|
|
|
<ContentWrap> |
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
<el-form |
|
|
|
<Search :schema="ItemBasic.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
|
<!-- <el-form |
|
|
|
class="-mb-15px" |
|
|
|
:model="queryParams" |
|
|
|
ref="queryFormRef" |
|
|
@ -353,12 +354,6 @@ |
|
|
|
> |
|
|
|
<Icon icon="ep:plus" class="mr-5px" /> 新增 |
|
|
|
</el-button> |
|
|
|
<el-button |
|
|
|
type="warning" |
|
|
|
@click="handleImport" |
|
|
|
v-hasPermi="['wms:itembasic:import']"> |
|
|
|
<Icon icon="ep:upload" /> 导入 |
|
|
|
</el-button> |
|
|
|
<el-button |
|
|
|
type="success" |
|
|
|
plain |
|
|
@ -369,174 +364,67 @@ |
|
|
|
<Icon icon="ep:download" class="mr-5px" /> 导出 |
|
|
|
</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> --> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
<ContentWrap> |
|
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> |
|
|
|
<el-table-column label="代码" align="center" prop="code" width="150px" /> |
|
|
|
<el-table-column label="名称" align="center" prop="name" width="150px" /> |
|
|
|
<el-table-column label="描述1" align="center" prop="desc1" width="150px" /> |
|
|
|
<el-table-column label="描述2" align="center" prop="desc2" width="150px" /> |
|
|
|
<el-table-column label="状态" align="center" prop="status" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :type="DICT_TYPE.ITEM_STATUS" :value="scope.row.status" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="计量单位" align="center" prop="uom" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :type="DICT_TYPE.UOM" :value="scope.row.uom" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="替代计量单位" align="center" prop="altUom" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :type="DICT_TYPE.UOM" :value="scope.row.altUom" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="是否标包" align="center" prop="isStdPack" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.isStdPack" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="可采购" align="center" prop="enableBuy" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.enableBuy" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="可制造" align="center" prop="enableMake" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.enableMake" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="可委外加工" align="center" prop="enableOutsourcing" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.enableOutsourcing" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="回收件" align="center" prop="isRecycled" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.isRecycled" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="虚零件" align="center" prop="isPhantom" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.isPhantom" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="ABC类" align="center" prop="abcClass" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :type="DICT_TYPE.ABC_CLASS" :value="scope.row.abcClass" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="类型" align="center" prop="type" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :type="DICT_TYPE.ITEM_TYPE" :value="scope.row.type" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="种类" align="center" prop="category" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :type="DICT_TYPE.ITEM_CATEGORY" :value="scope.row.category" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="分组" align="center" prop="itemGroup" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :type="DICT_TYPE.ITEM_GROUP" :value="scope.row.itemGroup" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="颜色" align="center" prop="color" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :type="DICT_TYPE.ITEM_COLOR" :value="scope.row.color" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="配置" align="center" prop="configuration" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :type="DICT_TYPE.ITEM_CONFIGURATION" :value="scope.row.configuration" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="项目" align="center" prop="project" width="150px" /> |
|
|
|
<el-table-column label="质量等级" align="center" prop="eqLevel" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :type="DICT_TYPE.EQ_LEVEL" :value="scope.row.eqLevel" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="有效天数" align="center" prop="validityDays" width="150px" /> |
|
|
|
<el-table-column label="是否可用" align="center" prop="available" width="150px" /> |
|
|
|
<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"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-button |
|
|
|
link |
|
|
|
type="primary" |
|
|
|
@click="openForm('update', scope.row.id)" |
|
|
|
v-hasPermi="['wms:itembasic:update']" |
|
|
|
> |
|
|
|
编辑 |
|
|
|
</el-button> |
|
|
|
<el-button |
|
|
|
link |
|
|
|
type="danger" |
|
|
|
@click="handleDelete(scope.row.id)" |
|
|
|
v-hasPermi="['wms:itembasic:delete']" |
|
|
|
> |
|
|
|
删除 |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<!-- 分页 --> |
|
|
|
<Pagination |
|
|
|
:total="total" |
|
|
|
v-model:page="queryParams.pageNo" |
|
|
|
v-model:limit="queryParams.pageSize" |
|
|
|
@pagination="getList" |
|
|
|
/> |
|
|
|
<Table |
|
|
|
:columns="ItemBasic.allSchemas.tableColumns" |
|
|
|
:data="tableObject.tableList" |
|
|
|
:loading="tableObject.loading" |
|
|
|
:pagination="{ |
|
|
|
total: tableObject.total |
|
|
|
}" |
|
|
|
v-model:pageSize="tableObject.pageSize" |
|
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
|
> |
|
|
|
<template #action="{ row }"> |
|
|
|
<el-button |
|
|
|
link |
|
|
|
type="primary" |
|
|
|
@click="openForm('update', row.id)" |
|
|
|
v-hasPermi="['wms:itembasic:update']" |
|
|
|
> |
|
|
|
编辑 |
|
|
|
</el-button> |
|
|
|
<el-button |
|
|
|
link |
|
|
|
type="danger" |
|
|
|
@click="handleDelete(row.id)" |
|
|
|
v-hasPermi="['wms:itembasic:delete']" |
|
|
|
> |
|
|
|
删除 |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
<ItembasicForm ref="formRef" @success="getList" /> |
|
|
|
<!-- 用户导入对话框 --> |
|
|
|
<ItembasicImportForm ref="importFormRef" @success="getList" /> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict' |
|
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
|
import download from '@/utils/download' |
|
|
|
import * as ItembasicApi from '@/api/wms/itembasic' |
|
|
|
import ItembasicForm from './ItembasicForm.vue' |
|
|
|
import ItembasicImportForm from './ItembasicImportForm.vue' |
|
|
|
import { ItemBasic } from '@/utils/disposition/tableColumns' |
|
|
|
|
|
|
|
// tableObject:表格的属性对象,可获得分页大小、条数等属性 |
|
|
|
// tableMethods:表格的操作对象,可进行获得分页、删除记录等操作 |
|
|
|
// 详细可见:https://doc.iocoder.cn/vue3/crud-schema/ |
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
getListApi: ItembasicApi.getItembasicPage // 分页接口 |
|
|
|
}) |
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
|
const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
defineOptions({ name: 'Itembasic' }) |
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
const { t } = useI18n() // 国际化 |
|
|
|
|
|
|
|
const loading = ref(true) // 列表的加载中 |
|
|
|
const total = ref(0) // 列表的总页数 |
|
|
|
const list = ref([]) // 列表的数据 |
|
|
|
const queryParams = reactive({ |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 10, |
|
|
@ -569,33 +457,8 @@ const queryParams = reactive({ |
|
|
|
createTime: [], |
|
|
|
creator: null |
|
|
|
}) |
|
|
|
const queryFormRef = ref() // 搜索的表单 |
|
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
|
|
|
|
|
/** 查询列表 */ |
|
|
|
const getList = async () => { |
|
|
|
loading.value = true |
|
|
|
try { |
|
|
|
const data = await ItembasicApi.getItembasicPage(queryParams) |
|
|
|
|
|
|
|
list.value = data.list |
|
|
|
total.value = data.total |
|
|
|
} finally { |
|
|
|
loading.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 搜索按钮操作 */ |
|
|
|
const handleQuery = () => { |
|
|
|
queryParams.pageNo = 1 |
|
|
|
getList() |
|
|
|
} |
|
|
|
|
|
|
|
/** 重置按钮操作 */ |
|
|
|
const resetQuery = () => { |
|
|
|
queryFormRef.value.resetFields() |
|
|
|
handleQuery() |
|
|
|
} |
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
|
const formRef = ref() |
|
|
@ -603,12 +466,6 @@ const openForm = (type: string, id?: number) => { |
|
|
|
formRef.value.open(type, id) |
|
|
|
} |
|
|
|
|
|
|
|
/** 用户导入 */ |
|
|
|
const importFormRef = ref() |
|
|
|
const handleImport = () => { |
|
|
|
importFormRef.value.open() |
|
|
|
} |
|
|
|
|
|
|
|
/** 删除按钮操作 */ |
|
|
|
const handleDelete = async (id: number) => { |
|
|
|
try { |
|
|
|