|
@ -1,17 +1,21 @@ |
|
|
<template> |
|
|
<template> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<!-- 搜索工作栏 --> |
|
|
<!-- 搜索工作栏 --> |
|
|
<Search :schema="Itempackaging.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
<Search |
|
|
|
|
|
:schema="Itempackaging.allSchemas.searchSchema" |
|
|
|
|
|
@search="setSearchParams" |
|
|
|
|
|
@reset="setSearchParams" |
|
|
|
|
|
/> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
<!-- 列表头部 --> |
|
|
<TableHead |
|
|
<TableHead |
|
|
:HeadButttondata="HeadButttondata" |
|
|
:HeadButttondata="HeadButttondata" |
|
|
@button-base-click="buttonBaseClick" |
|
|
@button-base-click="buttonBaseClick" |
|
|
:routeName="routeName" |
|
|
:routeName="routeName" |
|
|
@updataTableColumns="updataTableColumns" |
|
|
@updataTableColumns="updataTableColumns" |
|
|
@searchFormClick="searchFormClick" |
|
|
@searchFormClick="searchFormClick" |
|
|
:allSchemas="Itempackaging.allSchemas" |
|
|
:allSchemas="Itempackaging.allSchemas" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
<!-- 列表 --> |
|
@ -27,23 +31,23 @@ |
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
v-model:sort="tableObject.sort" |
|
|
v-model:sort="tableObject.sort" |
|
|
> |
|
|
> |
|
|
<template #itemCode="{row}"> |
|
|
<template #itemCode="{ row }"> |
|
|
<el-button type="primary" link @click="openDetail(row, '物料代码', row.itemCode)"> |
|
|
<el-button type="primary" link @click="openDetail(row, '物料代码', row.itemCode)"> |
|
|
<span>{{ row.itemCode }}</span> |
|
|
<span>{{ row.itemCode }}</span> |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
<template #action="{ row }"> |
|
|
<template #action="{ row }"> |
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" /> |
|
|
</template> |
|
|
</template> |
|
|
</Table> |
|
|
</Table> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<BasicForm |
|
|
<BasicForm |
|
|
ref="basicFormRef" |
|
|
ref="basicFormRef" |
|
|
@success="getList" |
|
|
@success="formsSuccess" |
|
|
:rules="ItempackagingRules" |
|
|
:rules="ItempackagingRules" |
|
|
:formAllSchemas="Itempackaging.allSchemas" |
|
|
:formAllSchemas="Itempackaging.allSchemas" |
|
|
:apiUpdate="ItempackagingApi.updateItempackaging" |
|
|
:apiUpdate="ItempackagingApi.updateItempackaging" |
|
|
:apiCreate="ItempackagingApi.createItempackaging" |
|
|
:apiCreate="ItempackagingApi.createItempackaging" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
@ -54,7 +58,12 @@ |
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="Itempackaging.allSchemas" /> |
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="Itempackaging.allSchemas" /> |
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm ref="importFormRef" url="/wms/itempackaging/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
<ImportForm |
|
|
|
|
|
ref="importFormRef" |
|
|
|
|
|
url="/wms/itempackaging/import" |
|
|
|
|
|
:importTemplateData="importTemplateData" |
|
|
|
|
|
@success="importSuccess" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
@ -63,7 +72,7 @@ import * as ItempackagingApi from '@/api/wms/itempackaging' |
|
|
import BasicForm from '@/components/BasicForm/src/BasicForm.vue' |
|
|
import BasicForm from '@/components/BasicForm/src/BasicForm.vue' |
|
|
import { Itempackaging, ItempackagingRules } from './itempackaging.data' |
|
|
import { Itempackaging, ItempackagingRules } from './itempackaging.data' |
|
|
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' |
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
|
|
|
|
|
@ -91,12 +100,12 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
// 列表头部按钮 |
|
|
const HeadButttondata = [ |
|
|
const HeadButttondata = [ |
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:itempackaging:create'}), // 新增 |
|
|
defaultButtons.defaultAddBtn({ hasPermi: 'wms:itempackaging:create' }), // 新增 |
|
|
defaultButtons.defaultImportBtn({hasPermi:'wms:itempackaging:import'}), // 导入 |
|
|
defaultButtons.defaultImportBtn({ hasPermi: 'wms:itempackaging:import' }), // 导入 |
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:itempackaging:export'}), // 导出 |
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'wms:itempackaging:export' }), // 导出 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
defaultButtons.defaultSetBtn(null) // 设置 |
|
|
// { |
|
|
// { |
|
|
// label: '自定义扩展按钮', |
|
|
// label: '自定义扩展按钮', |
|
|
// name: 'zdy', |
|
|
// name: 'zdy', |
|
@ -107,35 +116,43 @@ const HeadButttondata = [ |
|
|
// }, |
|
|
// }, |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
// 头部按钮事件 |
|
|
const buttonBaseClick = (val, item) => { |
|
|
const buttonBaseClick = (val, item) => { |
|
|
console.log(104, val) |
|
|
console.log(104, val) |
|
|
if (val == 'add') { // 新增 |
|
|
if (val == 'add') { |
|
|
|
|
|
// 新增 |
|
|
openForm('create') |
|
|
openForm('create') |
|
|
} else if (val == 'import') { // 导入 |
|
|
} else if (val == 'import') { |
|
|
|
|
|
// 导入 |
|
|
handleImport() |
|
|
handleImport() |
|
|
} else if (val == 'export') { // 导出 |
|
|
} else if (val == 'export') { |
|
|
|
|
|
// 导出 |
|
|
handleExport() |
|
|
handleExport() |
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
} else if (val == 'refresh') { |
|
|
|
|
|
// 刷新 |
|
|
getList() |
|
|
getList() |
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
} else if (val == 'filtrate') { |
|
|
} else { // 其他按钮 |
|
|
// 筛选 |
|
|
|
|
|
} else { |
|
|
|
|
|
// 其他按钮 |
|
|
console.log('其他按钮', item) |
|
|
console.log('其他按钮', item) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const butttondata = [ |
|
|
const butttondata = [ |
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:itempackaging:update'}), // 编辑 |
|
|
defaultButtons.mainListEditBtn({ hasPermi: 'wms:itempackaging:update' }), // 编辑 |
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:itempackaging:delete'}), // 删除 |
|
|
defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:itempackaging:delete' }) // 删除 |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'edit') { // 编辑 |
|
|
if (val == 'edit') { |
|
|
|
|
|
// 编辑 |
|
|
// const res = await ItempackagingApi.getItempackaging(row.id) |
|
|
// const res = await ItempackagingApi.getItempackaging(row.id) |
|
|
openForm('update', row) |
|
|
openForm('update', row) |
|
|
} else if (val == 'delete') { // 删除 |
|
|
} else if (val == 'delete') { |
|
|
|
|
|
// 删除 |
|
|
handleDelete(row.id) |
|
|
handleDelete(row.id) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -145,7 +162,28 @@ const basicFormRef = ref() |
|
|
const openForm = (type: string, row?: any) => { |
|
|
const openForm = (type: string, row?: any) => { |
|
|
basicFormRef.value.open(type, row) |
|
|
basicFormRef.value.open(type, row) |
|
|
} |
|
|
} |
|
|
|
|
|
const formsSuccess = async (formType, data) => { |
|
|
|
|
|
var isHave = Itempackaging.allSchemas.formSchema.some(function (item) { |
|
|
|
|
|
return item.field === 'activeTime' || item.field === 'expireTime' |
|
|
|
|
|
}) |
|
|
|
|
|
if (isHave) { |
|
|
|
|
|
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) { |
|
|
|
|
|
message.error('失效时间要大于生效时间') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (data.activeTime == 0) data.activeTime = null |
|
|
|
|
|
if (data.expireTime == 0) data.expireTime = null |
|
|
|
|
|
if (formType === 'create') { |
|
|
|
|
|
await ItempackagingApi.createItempackaging(data) |
|
|
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
|
|
} else { |
|
|
|
|
|
await ItempackagingApi.updateItempackaging(data) |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
} |
|
|
|
|
|
basicFormRef.value.dialogVisible = false |
|
|
|
|
|
getList() |
|
|
|
|
|
} |
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|