Browse Source

物品基本信息导入前端代码

master
chenfang 1 year ago
parent
commit
bfd0d00598
  1. 2
      src/views/wms/itembasic/ItembasicImportForm.vue
  2. 15
      src/views/wms/itembasic/index.vue

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

@ -129,3 +129,5 @@ const handleExceed = (): void => {
const importTemplate = async () => { const importTemplate = async () => {
const res = await ItembasicApi.importUserTemplate() const res = await ItembasicApi.importUserTemplate()
download.excel(res, '物品基本信息导入模版.xls') download.excel(res, '物品基本信息导入模版.xls')
}
</script>

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

@ -353,6 +353,12 @@
> >
<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
@ -511,6 +517,8 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<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">
@ -519,6 +527,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' })
@ -594,6 +603,12 @@ 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