Browse Source

包装信息详情

master
陈薪名 1 year ago
parent
commit
56654a6046
  1. 1
      src/components/Table/src/Table.vue
  2. 12
      src/router/modules/remaining.ts
  3. 15
      src/utils/disposition/defaultButtons.ts
  4. 122
      src/views/wms/itempackaging/ItempackagingDetail.vue
  5. 2
      src/views/wms/itempackaging/ItempackagingForm.vue
  6. 207
      src/views/wms/itempackaging/index.vue

1
src/components/Table/src/Table.vue

@ -292,6 +292,7 @@ export default defineComponent({
onSelection-change={selectionChange} onSelection-change={selectionChange}
onSort-change={sortChange} onSort-change={sortChange}
{...unref(getBindValue)} {...unref(getBindValue)}
stripe
> >
{{ {{
default: () => rnderTableColumn(), default: () => rnderTableColumn(),

12
src/router/modules/remaining.ts

@ -349,6 +349,18 @@ const remainingRouter: AppRouteRecordRaw[] = [
title: '物品详情', title: '物品详情',
activeMenu: '/wms/itembasic-manage/itembasic' activeMenu: '/wms/itembasic-manage/itembasic'
} }
},
{
path: '/wms/itempackaging-manage/itempackaging-detail',
component: () => import('@/views/wms/itempackaging/ItempackagingDetail.vue'),
name: 'ItempackagingDetail',
meta: {
noCache: true,
hidden: true,
canTo: true,
title: '包装详情',
activeMenu: '/wms/itempackaging-manage/itempackaging'
}
} }
] ]
} }

15
src/utils/disposition/defaultButtons.ts

@ -164,13 +164,26 @@ export function drawerDeleteBtn(option:any) {
}) })
} }
// 主列表-详情按钮
export function mainListDetailBtn(option:any) {
return __defaultBtnOption(option,{
label: '详情',
name: 'detail',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-编辑按钮 // 主列表-编辑按钮
export function mainListEditBtn(option:any) { export function mainListEditBtn(option:any) {
return __defaultBtnOption(option,{ return __defaultBtnOption(option,{
label: '编辑', label: '编辑',
name: 'edit', name: 'edit',
hide: false, hide: false,
type: 'primary', type: 'warning',
color: '', color: '',
link: true, // 文本展现按钮 link: true, // 文本展现按钮
hasPermi: '' hasPermi: ''

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

@ -0,0 +1,122 @@
<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>

2
src/views/wms/itempackaging/ItempackagingForm.vue

@ -121,7 +121,7 @@
<el-form-item label="是否可用" prop="available"> <el-form-item label="是否可用" prop="available">
<el-select v-model="formData.available" placeholder="请选择是否可用"> <el-select v-model="formData.available" placeholder="请选择是否可用">
<el-option <el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" v-for="dict in getStrDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"

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

@ -7,7 +7,7 @@
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@buttonBaseClick="buttonBaseClick" @button-base-click="buttonBaseClick"
/> />
<!-- 列表 --> <!-- 列表 -->
@ -24,121 +24,19 @@
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #action="{ row }"> <template #action="{ row }">
<el-button <ButtonBase
link :Butttondata="butttondata"
type="primary" @button-base-click="buttonTableClick($event,row)"
@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> </template>
</Table> </Table>
<!-- <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="物品代码" align="center" prop="itemCode" width="150px" />
<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="stdPackUnit" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PACK_UNIT" :value="scope.row.stdPackUnit" />
</template>
</el-table-column>
<el-table-column label="包装数量" align="center" prop="stdPackQty" width="150px" />
<el-table-column label="替代包装单位" align="center" prop="altPackUnit1" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PACK_UNIT" :value="scope.row.altPackUnit1" />
</template>
</el-table-column>
<el-table-column label="替代包装量" align="center" prop="altPackQty1" width="150px" />
<el-table-column label="替代包装单位" align="center" prop="altPackUnit2" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PACK_UNIT" :value="scope.row.altPackUnit2" />
</template>
</el-table-column>
<el-table-column label="替代包装量" align="center" prop="altPackQty2" width="150px" />
<el-table-column label="替代包装单位" align="center" prop="altPackUnit3" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PACK_UNIT" :value="scope.row.altPackUnit3" />
</template>
</el-table-column>
<el-table-column label="替代包装量" align="center" prop="altPackQty3" width="150px" />
<el-table-column label="替代包装单位" align="center" prop="altPackUnit4" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PACK_UNIT" :value="scope.row.altPackUnit4" />
</template>
</el-table-column>
<el-table-column label="替代包装量" align="center" prop="altPackQty4" width="150px" />
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<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" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:itempackaging:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:itempackaging: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>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<ItempackagingForm ref="formRef" @success="getList" /> <ItempackagingForm ref="formRef" @success="getList" />
<!-- 导入 -->
<ImportForm ref="importFormRef" :importTemplateData="importTemplateData" @success="importSuccess" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -148,6 +46,7 @@ import ItempackagingForm from './ItempackagingForm.vue'
import { Itempackaging } from '@/utils/disposition/tableColumns' import { Itempackaging } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
defineOptions({ name: 'Itempackaging' }) defineOptions({ name: 'Itempackaging' })
@ -160,9 +59,9 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn(null), // defaultButtons.defaultAddBtn({hasPermi:'wms:itempackaging:create'}), //
defaultButtons.defaultImportBtn(null), // defaultButtons.defaultImportBtn({hasPermi:'wms:itempackaging:import'}), //
defaultButtons.defaultExportBtn(null), // defaultButtons.defaultExportBtn({hasPermi:'wms:itempackaging:export'}), //
// defaultButtons.defaultFilterBtn(), // // defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
// { // {
@ -174,41 +73,45 @@ const HeadButttondata = [
// color: '' // color: ''
// }, // },
] ]
console.log(HeadButttondata);
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
// //
if (val == 'add') { if (val == 'add') {
console.log(417, item) openForm('create')
} } else if (val == 'import') { //
// handleImport()
else if (val == 'import') { } else if (val == 'export') { //
handleExport()
} } else if (val == 'refresh') { //
// getList()
else if (val == 'export') { } else if (val == 'filtrate') { //
handleExport() } else { //
} console.log('其他按钮', item)
// }
else if (val == 'refresh') { }
getList()
}
//
else if (val == 'filtrate') {
} // -
// const butttondata = [
else { 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') { //
openForm('update', row.id)
} else if (val == 'delete') { //
handleDelete(row.id)
} }
}
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const router = useRouter() //
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
@ -216,6 +119,17 @@ const openForm = (type: string, id?: number) => {
formRef.value.open(type, id) formRef.value.open(type, id)
} }
/** 详情操作 */
const openDetail = (id?: number) => {
// detailRef.value.open(id)
router.push({
path: '/wms/itempackaging-manage/itempackaging-detail',
query:{
id
}
})
}
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {
try { try {
@ -245,6 +159,21 @@ const handleExport = async () => {
} }
} }
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: 'test/sss',
templateTitle: '导入模版99.xls'
})
//
const importSuccess = () => {
}
/** 初始化 **/ /** 初始化 **/
onMounted(() => { onMounted(() => {
getList() getList()

Loading…
Cancel
Save