Browse Source

包装信息及物品基础修改

master
陈薪名 1 year ago
parent
commit
d80b316a18
  1. 123
      src/views/wms/itembasic/index.vue
  2. 122
      src/views/wms/itempackaging/ItempackagingDetail.vue
  3. 42
      src/views/wms/itempackaging/index.vue

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

@ -2,36 +2,38 @@
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ItemBasic.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
  <!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @buttonBaseClick="buttonBaseClick" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @buttonBaseClick="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<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="primary" @click="openDetail(row.id)" v-hasPermi="['wms:itembasic:update']">
详情
</el-button>
<el-button link type="danger" @click="handleDelete(row.id)" v-hasPermi="['wms:itembasic:delete']">
删除
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase
:Butttondata="butttondata"
@button-base-click="buttonTableClick($event,row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<ItembasicForm ref="formRef" @success="getList" />
<!-- 导入 -->
<ImportForm ref="importFormRef" :url="ItembasicApi.importUrl" :importTemplateData="importTemplateData"
@success="importSuccess" />
<!-- 详情 -->
<Detail ref="detailRef" />
<Detail ref="detailRef" :tabs="ItemBasicTabsList" :isBasic="true" :allSchemas="ItemBasic.allSchemas" />
</template>
<script setup lang="ts">
@ -39,14 +41,13 @@ import download from '@/utils/download'
import * as ItembasicApi from '@/api/wms/itembasic'
import ItembasicForm from './ItembasicForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import ItembasicDetail from './ItembasicDetail.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import { ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
const router = useRouter() //
// tableObject
// tableMethods
// https://doc.iocoder.cn/vue3/crud-schema/
import { ItemBasicTabsList } from '@/utils/disposition/tabsList'
defineOptions({ name: 'Itembasic' })
const { tableObject, tableMethods } = useTable({
getListApi: ItembasicApi.getItembasicPage //
})
@ -72,70 +73,39 @@ const HeadButttondata = [
//
const { getList, setSearchParams } = tableMethods
defineOptions({ name: 'Itembasic' })
const message = useMessage() //
const { t } = useI18n() //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
code: null,
name: null,
desc1: null,
desc2: null,
status: null,
uom: null,
altUom: null,
isStdPack: null,
enableBuy: null,
enableMake: null,
enableOutsourcing: null,
isRecycled: null,
isPhantom: null,
abcClass: null,
type: null,
category: null,
itemGroup: null,
color: null,
configuration: null,
project: null,
eqLevel: null,
validityDays: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
})
const exportLoading = ref(false) //
//
const buttonBaseClick = (val, item) => {
//
if (val == 'add') {
openForm('creat')
}
//
else if (val == 'import') {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
}
//
else if (val == 'export') {
} else if (val == 'export') { //
handleExport()
}
//
else if (val == 'refresh') {
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
//
else if (val == 'filtrate') {
}
//
else {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:itembasic:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:itembasic:delete'}), //
]
// -
const buttonTableClick = (val, row) => {
if (val == 'edit') { //
openForm('update', row.id)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
@ -150,7 +120,7 @@ const handleImport = () => {
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '导入模版99.xls'
templateTitle: '物品基础信息导入模版.xls'
})
//
@ -163,18 +133,9 @@ const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
const detailRef = ref()
const openDetail = (id?: number) => {
detailRef.value.openDetail(id)
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
// const openDetail = (id?: number) => {
// // detailRef.value.open(id)
// router.push({
// path: '/wms/itembasic-manage/itembasic-detail',
// query:{
// id
// }
// })
// }
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
@ -196,7 +157,7 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
const data = await ItembasicApi.exportItembasic(queryParams)
const data = await ItembasicApi.exportItembasic(setSearchParams)
download.excel(data, '物品基本信息.xls')
} catch {
} finally {

122
src/views/wms/itempackaging/ItempackagingDetail.vue

@ -1,122 +0,0 @@
<template>
<!-- <ContentWrap>
<div class="font-size-18px">
{{ detailData.itemCode }}
<span class="ml-20px font-size-16px">{{ detailData.uom }}</span>
</div>
</ContentWrap> -->
<div class="flex" v-if="current == 0">
<!-- 详情 -->
<ContentWrap class="w-[73%]">
<Descriptions :data="detailData" :schema="Itempackaging.allSchemas.detailSchema" :columns="2" />
</ContentWrap>
<ContentWrap class="w-[27%] ml-16px">
<!-- 附件组件 -->
<Annex :data="annexData" @handleImport="handleImport" @deleteAnnex="deleteAnnexSuccess" />
<!-- 备注组件 -->
<Remarks :data="remarksData" class="mt-20px" @submitSucss="remarksSubmitSucss" />
<!-- 变更记录组件 -->
<ChangeRecord :data="changeRecordData" class="mt-20px" />
</ContentWrap>
<!-- 用户导入对话框 -->
<ImportForm ref="importFormRef" :importTemplateData="importTemplateData" @success="importSuccess" />
</div>
</template>
<script lang="ts" setup>
defineOptions({ name: 'ItempackagingDetail' })
import Annex from '@/components/Annex/src/Annex.vue'
import Remarks from '@/components/Remarks/src/Remarks.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue'
import { Itempackaging } from '@/utils/disposition/tableColumns'
import { getItempackaging } from '@/api/wms/itempackaging'
import * as UserApi from '@/api/system/user'
const { query } = useRoute() //
//
const annexData = reactive({
annexList: [{
title: '文件名文件名2023-12-12.docx',
size: '150.02KB',
people: '贾先生',
time: '2023年5月6日 17:16:00',
}, {
title: '文件名文件名2023-12-15.docx',
size: '242KB',
people: '张张',
time: '2022年12月12日 17:16:00',
}]
})
//
const remarksData = reactive({
remarksList: [{
name: '诸葛亮',
text: '转朱阁,低绮户,照无眠。不应有恨,何事长向别时圆?人有悲欢离合,月有阴晴圆缺,此事古难全。但愿人长久,千里共婵娟。',
time: '2023年5月6日 17:16:00',
}, {
name: '刘备',
text: '转朱阁,低绮户,照无眠。不应有恨,何事长向别时圆?人有悲欢离合,月有阴晴圆缺,此事古难全。但愿人长久,千里共婵娟。',
time: '2022年12月12日 17:16:00',
}]
})
//
const changeRecordData = reactive({
changeRecordList: [{
name: '诸葛亮',
type: 1,
time: '2023年5月6日 17:16:00',
}, {
name: '刘备',
type: 2,
time: '2023年5月6日 17:16:00',
}, {
name: '曹操',
type: 3,
time: '2023年5月6日 17:16:00',
file: [{
name: '这是个附件的名字.docx',
url: 'http://localhost:12080/admin-api/system/user/get-import-template'
}, {
name: '这是个附件的名字.docx',
url: 'http://localhost:12080/admin-api/system/user/get-import-template'
}]
}]
})
const detailData = ref("")//
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '导入模版99.xls'
})
onMounted(async () => {
//
detailData.value = await getItempackaging(query.id)
console.log(97,detailData.value)
importTemplateData.templateUrl = await UserApi.importUserTemplate()
})
//
const importSuccess = () => {
}
/** 用户导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const deleteAnnexSuccess = async () => {
console.log('删除成功');
}
//
const remarksSubmitSucss = () => {
console.log('提交成功');
}
const current = ref(0)
</script>

42
src/views/wms/itempackaging/index.vue

@ -24,7 +24,7 @@
v-model:sort="tableObject.sort"
>
<template #itemCode="{row}">
<el-button type="primary" link @click="openDetail(row.id)">
<el-button type="primary" link @click="openDetail(row, '物料代码', row.itemCode)">
<span>{{ row.itemCode }}</span>
</el-button>
</template>
@ -40,8 +40,11 @@
<!-- 表单弹窗添加/修改 -->
<ItempackagingForm ref="formRef" @success="getList" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Itempackaging.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm ref="importFormRef" url="/wms/itempackaging/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
@ -52,10 +55,14 @@ import { Itempackaging } 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: 'Itempackaging' })
const message = useMessage() //
const { t } = useI18n() //
const { tableObject, tableMethods } = useTable({
getListApi: ItempackagingApi.getItempackagingPage //
})
@ -82,8 +89,7 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
//
if (val == 'add') {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
@ -99,26 +105,19 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
// defaultButtons.mainListDetailBtn(null), //
defaultButtons.mainListEditBtn({hasPermi:'wms:itempackaging:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:itempackaging:delete'}), //
]
//
// -
const buttonTableClick = (val, row) => {
if (val == 'detail') { //
openDetail(row.id)
} else if (val == 'edit') { //
if (val == 'edit') { //
openForm('update', row.id)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
const message = useMessage() //
const { t } = useI18n() //
const router = useRouter() //
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
@ -126,14 +125,9 @@ const openForm = (type: string, id?: number) => {
}
/** 详情操作 */
const openDetail = (id?: number) => {
// detailRef.value.open(id)
router.push({
path: '/wms/itempackaging-manage/itempackaging-detail',
query:{
id
}
})
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -172,12 +166,12 @@ const handleImport = () => {
}
//
const importTemplateData = reactive({
templateUrl: 'test/sss',
templateTitle: '导入模版99.xls'
templateUrl: '',
templateTitle: '物品包装信息导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/

Loading…
Cancel
Save