Browse Source

模板

master
zhangli 1 year ago
parent
commit
652af77503
  1. 14
      src/App.vue
  2. 213
      src/views/wms/itembasic/ItembasicForm.vue
  3. 133
      src/views/wms/itembasic/ItembasicImportForm.vue
  4. 426
      src/views/wms/itembasic/index.vue

14
src/App.vue

@ -57,4 +57,18 @@ body {
.el-select{ .el-select{
width: 100%; width: 100%;
} }
/* 垂直滚动条样式 */
/* 宽度 */
::-webkit-scrollbar {
width: 12px;
}
/* 背景色 */
::-webkit-scrollbar-track {
background-color: #f5f5f5;
}
/* 滑块颜色 */
::-webkit-scrollbar-thumb {
background-color: #c1c1c1;
border-radius: 12px;
}
</style> </style>

213
src/views/wms/itembasic/ItembasicForm.vue

@ -1,217 +1,198 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form <div class="p-20px m--10px" style="max-height: 600px;overflow-y: auto;">
ref="formRef" <el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px" v-loading="formLoading"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
> >
<el-row>
<el-col :span="12">
<el-form-item label="代码" prop="code"> <el-form-item label="代码" prop="code">
<el-input v-model="formData.code" placeholder="请输入代码" /> <el-input v-model="formData.code" placeholder="请输入代码" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入名称" /> <el-input v-model="formData.name" placeholder="请输入名称" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述1" prop="desc1"> <el-form-item label="描述1" prop="desc1">
<el-input v-model="formData.desc1" placeholder="请输入描述1" /> <el-input v-model="formData.desc1" placeholder="请输入描述1" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述2" prop="desc2"> <el-form-item label="描述2" prop="desc2">
<el-input v-model="formData.desc2" placeholder="请输入描述2" /> <el-input v-model="formData.desc2" placeholder="请输入描述2" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select v-model="formData.status" placeholder="请选择状态"> <el-select v-model="formData.status" placeholder="请选择状态">
<el-option <el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_STATUS)" :key="dict.value" :label="dict.label"
v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_STATUS)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="计量单位" prop="uom"> <el-form-item label="计量单位" prop="uom">
<el-select v-model="formData.uom" placeholder="请选择计量单位"> <el-select v-model="formData.uom" placeholder="请选择计量单位">
<el-option <el-option v-for="dict in getStrDictOptions(DICT_TYPE.UOM)" :key="dict.value" :label="dict.label"
v-for="dict in getStrDictOptions(DICT_TYPE.UOM)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="替代计量单位" prop="altUom"> <el-form-item label="替代计量单位" prop="altUom">
<el-select v-model="formData.altUom" placeholder="请选择替代计量单位"> <el-select v-model="formData.altUom" placeholder="请选择替代计量单位">
<el-option <el-option v-for="dict in getStrDictOptions(DICT_TYPE.UOM)" :key="dict.value" :label="dict.label"
v-for="dict in getStrDictOptions(DICT_TYPE.UOM)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否标包" prop="isStdPack"> <el-form-item label="是否标包" prop="isStdPack">
<el-select v-model="formData.isStdPack" placeholder="请选择是否标包"> <el-select v-model="formData.isStdPack" placeholder="请选择是否标包">
<el-option <el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="可采购" prop="enableBuy"> <el-form-item label="可采购" prop="enableBuy">
<el-select v-model="formData.enableBuy" placeholder="请选择可采购"> <el-select v-model="formData.enableBuy" placeholder="请选择可采购">
<el-option <el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="可制造" prop="enableMake"> <el-form-item label="可制造" prop="enableMake">
<el-select v-model="formData.enableMake" placeholder="请选择可制造"> <el-select v-model="formData.enableMake" placeholder="请选择可制造">
<el-option <el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="可委外加工" prop="enableOutsourcing"> <el-form-item label="可委外加工" prop="enableOutsourcing">
<el-select v-model="formData.enableOutsourcing" placeholder="请选择可委外加工"> <el-select v-model="formData.enableOutsourcing" placeholder="请选择可委外加工">
<el-option <el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="回收件" prop="isRecycled"> <el-form-item label="回收件" prop="isRecycled">
<el-select v-model="formData.isRecycled" placeholder="请选择回收件"> <el-select v-model="formData.isRecycled" placeholder="请选择回收件">
<el-option <el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="虚零件" prop="isPhantom"> <el-form-item label="虚零件" prop="isPhantom">
<el-select v-model="formData.isPhantom" placeholder="请选择虚零件"> <el-select v-model="formData.isPhantom" placeholder="请选择虚零件">
<el-option <el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="ABC类" prop="abcClass"> <el-form-item label="ABC类" prop="abcClass">
<el-select v-model="formData.abcClass" placeholder="请选择ABC类"> <el-select v-model="formData.abcClass" placeholder="请选择ABC类">
<el-option <el-option v-for="dict in getStrDictOptions(DICT_TYPE.ABC_CLASS)" :key="dict.value" :label="dict.label"
v-for="dict in getStrDictOptions(DICT_TYPE.ABC_CLASS)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="类型" prop="type"> <el-form-item label="类型" prop="type">
<el-select v-model="formData.type" placeholder="请选择类型"> <el-select v-model="formData.type" placeholder="请选择类型">
<el-option <el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_TYPE)" :key="dict.value" :label="dict.label"
v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_TYPE)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="种类" prop="category"> <el-form-item label="种类" prop="category">
<el-select v-model="formData.category" placeholder="请选择种类"> <el-select v-model="formData.category" placeholder="请选择种类">
<el-option <el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_CATEGORY)" :key="dict.value" :label="dict.label"
v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_CATEGORY)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="分组" prop="itemGroup"> <el-form-item label="分组" prop="itemGroup">
<el-select v-model="formData.itemGroup" placeholder="请选择分组"> <el-select v-model="formData.itemGroup" placeholder="请选择分组">
<el-option <el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_GROUP)" :key="dict.value" :label="dict.label"
v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_GROUP)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="颜色" prop="color"> <el-form-item label="颜色" prop="color">
<el-select v-model="formData.color" placeholder="请选择颜色"> <el-select v-model="formData.color" placeholder="请选择颜色">
<el-option <el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_COLOR)" :key="dict.value" :label="dict.label"
v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_COLOR)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="配置" prop="configuration"> <el-form-item label="配置" prop="configuration">
<el-select v-model="formData.configuration" placeholder="请选择配置"> <el-select v-model="formData.configuration" placeholder="请选择配置">
<el-option <el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_CONFIGURATION)" :key="dict.value"
v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_CONFIGURATION)" :label="dict.label" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目" prop="project"> <el-form-item label="项目" prop="project">
<el-input v-model="formData.project" placeholder="请输入项目" /> <el-input v-model="formData.project" placeholder="请输入项目" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="质量等级" prop="eqLevel"> <el-form-item label="质量等级" prop="eqLevel">
<el-select v-model="formData.eqLevel" placeholder="请选择质量等级"> <el-select v-model="formData.eqLevel" placeholder="请选择质量等级">
<el-option <el-option v-for="dict in getStrDictOptions(DICT_TYPE.EQ_LEVEL)" :key="dict.value" :label="dict.label"
v-for="dict in getStrDictOptions(DICT_TYPE.EQ_LEVEL)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="有效天数" prop="validityDays"> <el-form-item label="有效天数" prop="validityDays">
<el-input v-model="formData.validityDays" placeholder="请输入有效天数" /> <el-input v-model="formData.validityDays" placeholder="请输入有效天数" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否可用" prop="available"> <el-form-item label="是否可用" prop="available">
<el-input v-model="formData.available" placeholder="请输入是否可用" /> <el-input v-model="formData.available" placeholder="请输入是否可用" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="生效时间" prop="activeTime"> <el-form-item label="生效时间" prop="activeTime">
<el-date-picker <el-date-picker style="width: 100%;" v-model="formData.activeTime" type="date" value-format="x"
v-model="formData.activeTime" placeholder="选择生效时间" />
type="date"
value-format="x"
placeholder="选择生效时间"
/>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="失效时间" prop="expireTime"> <el-form-item label="失效时间" prop="expireTime">
<el-date-picker <el-date-picker style="width: 100%;" v-model="formData.expireTime" type="date" value-format="x"
v-model="formData.expireTime" placeholder="选择失效时间" />
type="date"
value-format="x"
placeholder="选择失效时间"
/>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" placeholder="请输入备注" /> <el-input v-model="formData.remark" placeholder="请输入备注" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
</div>
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
</template> </template>
</Dialog> </Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -347,3 +328,7 @@ const resetForm = () => {
formRef.value?.resetFields() formRef.value?.resetFields()
} }
</script> </script>
<style scoped>
</style>

133
src/views/wms/itembasic/ItembasicImportForm.vue

@ -0,0 +1,133 @@
<template>
<Dialog v-model="dialogVisible" title="物品基本信息导入" width="400">
<el-upload
ref="uploadRef"
v-model:file-list="fileList"
:action="importUrl + '?updateSupport=' + updateSupport"
:auto-upload="false"
:disabled="formLoading"
:headers="uploadHeaders"
:limit="1"
:on-error="submitFormError"
:on-exceed="handleExceed"
:on-success="submitFormSuccess"
accept=".xlsx, .xls"
drag
>
<Icon icon="ep:upload" />
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<template #tip>
<div class="el-upload__tip text-center">
<div class="el-upload__tip">
<el-checkbox v-model="updateSupport" />
是否更新已经存在的物品基本信息数据
</div>
<span>仅允许导入 xlsxlsx 格式文件</span>
<el-link
:underline="false"
style="font-size: 12px; vertical-align: baseline"
type="primary"
@click="importTemplate"
>
下载模板
</el-link>
</div>
</template>
</el-upload>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script lang="ts" setup>
import * as UserApi from '@/api/system/user'
import { getAccessToken, getTenantId } from '@/utils/auth'
import download from '@/utils/download'
defineOptions({ name: 'SystemUserImportForm' })
const message = useMessage() //
const dialogVisible = ref(false) //
const formLoading = ref(false) //
const uploadRef = ref()
const importUrl =
import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/system/user/import'
const uploadHeaders = ref() // Header
const fileList = ref([]) //
const updateSupport = ref(0) //
/** 打开弹窗 */
const open = () => {
dialogVisible.value = true
resetForm()
}
defineExpose({ open }) // open
/** 提交表单 */
const submitForm = async () => {
if (fileList.value.length == 0) {
message.error('请上传文件')
return
}
//
uploadHeaders.value = {
Authorization: 'Bearer ' + getAccessToken(),
'tenant-id': getTenantId()
}
formLoading.value = true
uploadRef.value!.submit()
}
/** 文件上传成功 */
const emits = defineEmits(['success'])
const submitFormSuccess = (response: any) => {
if (response.code !== 0) {
message.error(response.msg)
formLoading.value = false
return
}
//
const data = response.data
let text = '上传成功数量:' + data.createUsernames.length + ';'
for (let username of data.createUsernames) {
text += '< ' + username + ' >'
}
text += '更新成功数量:' + data.updateUsernames.length + ';'
for (const username of data.updateUsernames) {
text += '< ' + username + ' >'
}
text += '更新失败数量:' + Object.keys(data.failureUsernames).length + ';'
for (const username in data.failureUsernames) {
text += '< ' + username + ': ' + data.failureUsernames[username] + ' >'
}
message.alert(text)
//
emits('success')
}
/** 上传错误提示 */
const submitFormError = (): void => {
message.error('上传失败,请您重新上传!')
formLoading.value = false
}
/** 重置表单 */
const resetForm = () => {
//
formLoading.value = false
uploadRef.value?.clearFiles()
}
/** 文件数超出提示 */
const handleExceed = (): void => {
message.error('最多只能上传一个文件!')
}
/** 下载模板操作 */
const importTemplate = async () => {
const res = await UserApi.importUserTemplate()
download.excel(res, '物品基本信息导入模版.xls')
}
</script>

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

@ -1,365 +1,163 @@
<template> <template>
<!-- 物品基本信息管理 -->
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="96px">
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="代码" prop="code"> <el-form-item label="代码" prop="code">
<el-input <el-input v-model="queryParams.code" placeholder="请输入代码" clearable @keyup.enter="handleQuery" class="!w-240px" />
v-model="queryParams.code"
placeholder="请输入代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> </el-form-item>
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input <el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter="handleQuery" class="!w-240px" />
v-model="queryParams.name"
placeholder="请输入名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> </el-form-item>
<el-form-item label="描述1" prop="desc1"> <el-form-item label="描述1" prop="desc1">
<el-input <el-input v-model="queryParams.desc1" placeholder="请输入描述1" clearable @keyup.enter="handleQuery"
v-model="queryParams.desc1" class="!w-240px" />
placeholder="请输入描述1"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> </el-form-item>
<el-form-item label="描述2" prop="desc2"> <el-form-item label="描述2" prop="desc2">
<el-input <el-input v-model="queryParams.desc2" placeholder="请输入描述2" clearable @keyup.enter="handleQuery"
v-model="queryParams.desc2" class="!w-240px" />
placeholder="请输入描述2"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px"> <el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px">
<el-option <el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_STATUS)" :key="dict.value" :label="dict.label"
v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_STATUS)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="计量单位" prop="uom"> <el-form-item label="计量单位" prop="uom">
<el-select v-model="queryParams.uom" placeholder="请选择计量单位" clearable class="!w-240px"> <el-select v-model="queryParams.uom" placeholder="请选择计量单位" clearable class="!w-240px">
<el-option <el-option v-for="dict in getStrDictOptions(DICT_TYPE.UOM)" :key="dict.value" :label="dict.label"
v-for="dict in getStrDictOptions(DICT_TYPE.UOM)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="替代计量单位" prop="altUom"> <el-form-item label="替代计量单位" prop="altUom">
<el-select <el-select v-model="queryParams.altUom" placeholder="请选择替代计量单位" clearable class="!w-240px">
v-model="queryParams.altUom" <el-option v-for="dict in getStrDictOptions(DICT_TYPE.UOM)" :key="dict.value" :label="dict.label"
placeholder="请选择替代计量单位" :value="dict.value" />
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.UOM)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="是否标包" prop="isStdPack"> <el-form-item label="是否标包" prop="isStdPack">
<el-select <el-select v-model="queryParams.isStdPack" placeholder="请选择是否标包" clearable class="!w-240px">
v-model="queryParams.isStdPack" <el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
placeholder="请选择是否标包" :value="dict.value" />
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-select>
</el-form-item> </el-form-item>
<el-form-item label="可采购" prop="enableBuy"> <el-form-item label="可采购" prop="enableBuy">
<el-select <el-select v-model="queryParams.enableBuy" placeholder="请选择可采购" clearable class="!w-240px">
v-model="queryParams.enableBuy" <el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
placeholder="请选择可采购" :value="dict.value" />
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-select>
</el-form-item> </el-form-item>
<el-form-item label="可制造" prop="enableMake"> <el-form-item label="可制造" prop="enableMake">
<el-select <el-select v-model="queryParams.enableMake" placeholder="请选择可制造" clearable class="!w-240px">
v-model="queryParams.enableMake" <el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
placeholder="请选择可制造" :value="dict.value" />
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-select>
</el-form-item> </el-form-item>
<el-form-item label="可委外加工" prop="enableOutsourcing"> <el-form-item label="可委外加工" prop="enableOutsourcing">
<el-select <el-select v-model="queryParams.enableOutsourcing" placeholder="请选择可委外加工" clearable class="!w-240px">
v-model="queryParams.enableOutsourcing" <el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
placeholder="请选择可委外加工" :value="dict.value" />
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-select>
</el-form-item> </el-form-item>
<el-form-item label="回收件" prop="isRecycled"> <el-form-item label="回收件" prop="isRecycled">
<el-select <el-select v-model="queryParams.isRecycled" placeholder="请选择回收件" clearable class="!w-240px">
v-model="queryParams.isRecycled" <el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
placeholder="请选择回收件" :value="dict.value" />
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-select>
</el-form-item> </el-form-item>
<el-form-item label="虚零件" prop="isPhantom"> <el-form-item label="虚零件" prop="isPhantom">
<el-select <el-select v-model="queryParams.isPhantom" placeholder="请选择虚零件" clearable class="!w-240px">
v-model="queryParams.isPhantom" <el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
placeholder="请选择虚零件" :value="dict.value" />
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-select>
</el-form-item> </el-form-item>
<el-form-item label="ABC类" prop="abcClass"> <el-form-item label="ABC类" prop="abcClass">
<el-select <el-select v-model="queryParams.abcClass" placeholder="请选择ABC类" clearable class="!w-240px">
v-model="queryParams.abcClass" <el-option v-for="dict in getStrDictOptions(DICT_TYPE.ABC_CLASS)" :key="dict.value" :label="dict.label"
placeholder="请选择ABC类" :value="dict.value" />
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ABC_CLASS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="类型" prop="type"> <el-form-item label="类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable class="!w-240px"> <el-select v-model="queryParams.type" placeholder="请选择类型" clearable class="!w-240px">
<el-option <el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_TYPE)" :key="dict.value" :label="dict.label"
v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_TYPE)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="种类" prop="category"> <el-form-item label="种类" prop="category">
<el-select <el-select v-model="queryParams.category" placeholder="请选择种类" clearable class="!w-240px">
v-model="queryParams.category" <el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_CATEGORY)" :key="dict.value" :label="dict.label"
placeholder="请选择种类" :value="dict.value" />
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_CATEGORY)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="分组" prop="itemGroup"> <el-form-item label="分组" prop="itemGroup">
<el-select <el-select v-model="queryParams.itemGroup" placeholder="请选择分组" clearable class="!w-240px">
v-model="queryParams.itemGroup" <el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_GROUP)" :key="dict.value" :label="dict.label"
placeholder="请选择分组" :value="dict.value" />
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_GROUP)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="颜色" prop="color"> <el-form-item label="颜色" prop="color">
<el-select v-model="queryParams.color" placeholder="请选择颜色" clearable class="!w-240px"> <el-select v-model="queryParams.color" placeholder="请选择颜色" clearable class="!w-240px">
<el-option <el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_COLOR)" :key="dict.value" :label="dict.label"
v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_COLOR)" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="配置" prop="configuration"> <el-form-item label="配置" prop="configuration">
<el-select <el-select v-model="queryParams.configuration" placeholder="请选择配置" clearable class="!w-240px">
v-model="queryParams.configuration" <el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_CONFIGURATION)" :key="dict.value" :label="dict.label"
placeholder="请选择配置" :value="dict.value" />
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_CONFIGURATION)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="项目" prop="project"> <el-form-item label="项目" prop="project">
<el-input <el-input v-model="queryParams.project" placeholder="请输入项目" clearable @keyup.enter="handleQuery"
v-model="queryParams.project" class="!w-240px" />
placeholder="请输入项目"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> </el-form-item>
<el-form-item label="质量等级" prop="eqLevel"> <el-form-item label="质量等级" prop="eqLevel">
<el-select <el-select v-model="queryParams.eqLevel" placeholder="请选择质量等级" clearable class="!w-240px">
v-model="queryParams.eqLevel" <el-option v-for="dict in getStrDictOptions(DICT_TYPE.EQ_LEVEL)" :key="dict.value" :label="dict.label"
placeholder="请选择质量等级" :value="dict.value" />
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.EQ_LEVEL)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="有效天数" prop="validityDays"> <el-form-item label="有效天数" prop="validityDays">
<el-input <el-input v-model="queryParams.validityDays" placeholder="请输入有效天数" clearable @keyup.enter="handleQuery"
v-model="queryParams.validityDays" class="!w-240px" />
placeholder="请输入有效天数"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-input
v-model="queryParams.available"
placeholder="请输入是否可用"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> </el-form-item>
<el-form-item label="生效时间" prop="activeTime"> <el-form-item label="生效时间" prop="activeTime">
<el-date-picker <el-date-picker v-model="queryParams.activeTime" value-format="YYYY-MM-DD HH:mm:ss" type="daterange"
v-model="queryParams.activeTime" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
value-format="YYYY-MM-DD HH:mm:ss" class="!w-240px" />
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>
<el-form-item label="失效时间" prop="expireTime"> <el-form-item label="失效时间" prop="expireTime">
<el-date-picker <el-date-picker v-model="queryParams.expireTime" value-format="YYYY-MM-DD HH:mm:ss" type="daterange"
v-model="queryParams.expireTime" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
value-format="YYYY-MM-DD HH:mm:ss" class="!w-240px" />
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>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input <el-input v-model="queryParams.remark" placeholder="请输入备注" clearable @keyup.enter="handleQuery"
v-model="queryParams.remark" class="!w-240px" />
placeholder="请输入备注"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="创建时间" prop="createTime">
<el-date-picker <el-date-picker v-model="queryParams.createTime" value-format="YYYY-MM-DD HH:mm:ss" type="daterange"
v-model="queryParams.createTime" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
value-format="YYYY-MM-DD HH:mm:ss" class="!w-240px" />
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>
<el-form-item label="创建者ID" prop="creator"> <el-form-item label="创建者ID" prop="creator">
<el-input <el-input v-model="queryParams.creator" placeholder="请输入创建者ID" clearable @keyup.enter="handleQuery"
v-model="queryParams.creator" class="!w-240px" />
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> <el-button type="info" plain @click="handleQuery">
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> <Icon icon="ep:search" class="mr-5px" /> 搜索
<el-button </el-button>
type="primary" <el-button type="info" plain @click="resetQuery">
plain <Icon icon="ep:refresh" class="mr-5px" /> 重置
@click="openForm('create')" </el-button>
v-hasPermi="['wms:itembasic:create']" <el-button type="primary" @click="openForm('create')" v-hasPermi="['wms:itembasic:create']">
>
<Icon icon="ep:plus" class="mr-5px" /> 新增 <Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button> </el-button>
<el-button <el-button type="warning" @click="handleImport" v-hasPermi="['wms:itembasic:import']">
type="success" <Icon icon="ep:upload" /> 导入
plain </el-button>
@click="handleExport" <el-button type="success" @click="handleExport" :loading="exportLoading" v-hasPermi="['wms:itembasic:export']">
:loading="exportLoading"
v-hasPermi="['wms:itembasic:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出 <Icon icon="ep:download" class="mr-5px" /> 导出
</el-button> </el-button>
</el-form-item> </el-form-item>
@ -456,59 +254,32 @@
</el-table-column> </el-table-column>
<el-table-column label="有效天数" align="center" prop="validityDays" width="150px" /> <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="available" width="150px" />
<el-table-column <el-table-column label="生效时间" align="center" prop="activeTime" :formatter="dateFormatter" width="150px" />
label="生效时间" <el-table-column label="失效时间" align="center" prop="expireTime" :formatter="dateFormatter" width="150px" />
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="remark" width="150px" />
<el-table-column <el-table-column label="创建时间" align="center" prop="createTime" :formatter="dateFormatter" width="150px" />
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" /> <el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px"> <el-table-column label="操作" align="center" width="240px" fixed='right'>
<template #default="scope"> <template #default="scope">
<el-button <el-button link type="primary" @click="openForm('update', scope.row.id)" v-hasPermi="['wms:itembasic:update']">
link <Icon icon="ep:edit" />编辑
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:itembasic:update']"
>
编辑
</el-button> </el-button>
<el-button <el-button link type="primary" @click="openForm('update', scope.row.id)" v-hasPermi="['wms:itembasic:update']">
link <Icon icon="ep:document-copy" />详情
type="danger" </el-button>
@click="handleDelete(scope.row.id)" <el-button link type="danger" @click="handleDelete(scope.row.id)" v-hasPermi="['wms:itembasic:delete']">
v-hasPermi="['wms:itembasic:delete']" <Icon icon="ep:delete" /> 删除
>
删除
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页 --> <!-- 分页 -->
<Pagination <Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
:total="total" @pagination="getList" />
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap> </ContentWrap>
<!-- 物品基本信息管理导入对话框 -->
<ItembasicImportForm ref="importFormRef" @success="getList" />
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<ItembasicForm ref="formRef" @success="getList" /> <ItembasicForm ref="formRef" @success="getList" />
</template> </template>
@ -519,6 +290,7 @@ 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'
defineOptions({ name: 'Itembasic' }) defineOptions({ name: 'Itembasic' })
@ -587,6 +359,12 @@ const resetQuery = () => {
handleQuery() handleQuery()
} }
/** 用户导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = (type: string, id?: number) => { const openForm = (type: string, id?: number) => {

Loading…
Cancel
Save