Browse Source

物品基础信息修改

master
陈薪名 12 months ago
parent
commit
a8eabe7d8e
  1. 229
      src/views/wms/itembasic/index.vue

229
src/views/wms/itembasic/index.vue

@ -1,7 +1,8 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <Search :schema="ItemBasic.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<!-- <el-form
class="-mb-15px" class="-mb-15px"
:model="queryParams" :model="queryParams"
ref="queryFormRef" ref="queryFormRef"
@ -353,12 +354,6 @@
> >
<Icon icon="ep:plus" class="mr-5px" /> 新增 <Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button> </el-button>
<el-button
type="warning"
@click="handleImport"
v-hasPermi="['wms:itembasic:import']">
<Icon icon="ep:upload" /> 导入
</el-button>
<el-button <el-button
type="success" type="success"
plain plain
@ -369,174 +364,67 @@
<Icon icon="ep:download" class="mr-5px" /> 导出 <Icon icon="ep:download" class="mr-5px" /> 导出
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form> -->
</ContentWrap> </ContentWrap>
<!-- 列表 --> <!-- 列表 -->
<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="ItemBasic.allSchemas.tableColumns"
<el-table-column label="名称" align="center" prop="name" width="150px" /> :data="tableObject.tableList"
<el-table-column label="描述1" align="center" prop="desc1" width="150px" /> :loading="tableObject.loading"
<el-table-column label="描述2" align="center" prop="desc2" width="150px" /> :pagination="{
<el-table-column label="状态" align="center" prop="status" width="150px"> total: tableObject.total
<template #default="scope"> }"
<dict-tag :type="DICT_TYPE.ITEM_STATUS" :value="scope.row.status" /> v-model:pageSize="tableObject.pageSize"
</template> v-model:currentPage="tableObject.currentPage"
</el-table-column> >
<el-table-column label="计量单位" align="center" prop="uom" width="150px"> <template #action="{ row }">
<template #default="scope"> <el-button
<dict-tag :type="DICT_TYPE.UOM" :value="scope.row.uom" /> link
</template> type="primary"
</el-table-column> @click="openForm('update', row.id)"
<el-table-column label="替代计量单位" align="center" prop="altUom" width="150px"> v-hasPermi="['wms:itembasic:update']"
<template #default="scope"> >
<dict-tag :type="DICT_TYPE.UOM" :value="scope.row.altUom" /> 编辑
</template> </el-button>
</el-table-column> <el-button
<el-table-column label="是否标包" align="center" prop="isStdPack" width="150px"> link
<template #default="scope"> type="danger"
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.isStdPack" /> @click="handleDelete(row.id)"
</template> v-hasPermi="['wms:itembasic:delete']"
</el-table-column> >
<el-table-column label="可采购" align="center" prop="enableBuy" width="150px"> 删除
<template #default="scope"> </el-button>
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.enableBuy" /> </template>
</template> </Table>
</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"
/>
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<ItembasicForm ref="formRef" @success="getList" /> <ItembasicForm ref="formRef" @success="getList" />
<!-- 用户导入对话框 -->
<ItembasicImportForm ref="importFormRef" @success="getList" />
</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 ItembasicApi from '@/api/wms/itembasic' import * as ItembasicApi from '@/api/wms/itembasic'
import ItembasicForm from './ItembasicForm.vue' 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' }) defineOptions({ name: 'Itembasic' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
@ -569,33 +457,8 @@ const queryParams = reactive({
createTime: [], createTime: [],
creator: null creator: null
}) })
const queryFormRef = ref() //
const exportLoading = ref(false) // 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() const formRef = ref()
@ -603,12 +466,6 @@ const openForm = (type: string, id?: number) => {
formRef.value.open(type, id) formRef.value.open(type, id)
} }
/** 用户导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {
try { try {

Loading…
Cancel
Save