|
@ -35,13 +35,28 @@ |
|
|
<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> |
|
|
|
|
|
<template #itemTypes="{row}"> |
|
|
|
|
|
<span>{{ strFor(row.itemTypes,DICT_TYPE.ITEM_TYPE)}}</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
<template #outLocationTypes="{row}"> |
|
|
|
|
|
<span>{{ strFor(row.outLocationTypes,DICT_TYPE.LOCATION_TYPE)}}</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
<template #inLocationTypes="{row}"> |
|
|
|
|
|
<span>{{ strFor(row.inLocationTypes,DICT_TYPE.LOCATION_TYPE)}}</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
<template #outInventoryStatuses="{row}"> |
|
|
|
|
|
<span>{{ strFor(row.outInventoryStatuses,DICT_TYPE.INVENTORY_STATUS)}}</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
<template #inInventoryStatuses="{row}"> |
|
|
|
|
|
<span>{{ strFor(row.inInventoryStatuses,DICT_TYPE.INVENTORY_STATUS)}}</span> |
|
|
|
|
|
</template> |
|
|
</Table> |
|
|
</Table> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<BasicForm |
|
|
<BasicForm |
|
|
ref="basicFormRef" |
|
|
ref="basicFormRef" |
|
|
@success="formsSuccess" |
|
|
@success="formsSuccess" |
|
|
:rules="BusinesstypeRules" |
|
|
:rules="BusinesstypeRules" |
|
|
:formAllSchemas="Businesstype.allSchemas" |
|
|
:formAllSchemas="Businesstype.allSchemas" |
|
|
:apiUpdate="BusinesstypeApi.updateBusinesstype" |
|
|
:apiUpdate="BusinesstypeApi.updateBusinesstype" |
|
@ -59,6 +74,7 @@ |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
|
|
|
import { getDictLabel,DICT_TYPE } from '@/utils/dict' |
|
|
import * as BusinesstypeApi from '@/api/wms/businesstype' |
|
|
import * as BusinesstypeApi from '@/api/wms/businesstype' |
|
|
import BasicForm from '@/components/BasicForm/src/BasicForm.vue' |
|
|
import BasicForm from '@/components/BasicForm/src/BasicForm.vue' |
|
|
import { Businesstype, BusinesstypeRules } from './businesstype.data' |
|
|
import { Businesstype, BusinesstypeRules } from './businesstype.data' |
|
@ -70,6 +86,23 @@ import Detail from '@/components/Detail/src/Detail.vue' |
|
|
// 业务类型 |
|
|
// 业务类型 |
|
|
defineOptions({ name: 'Businesstype' }) |
|
|
defineOptions({ name: 'Businesstype' }) |
|
|
|
|
|
|
|
|
|
|
|
const strFor = (str,type)=> { |
|
|
|
|
|
let stradd = '' |
|
|
|
|
|
if(typeof(str)=='string'){ |
|
|
|
|
|
str.split(',').forEach(element => { |
|
|
|
|
|
let str1=getDictLabel(type,element) |
|
|
|
|
|
stradd = stradd+str1+',' |
|
|
|
|
|
}) |
|
|
|
|
|
return stradd.substring(0,stradd.length-1) |
|
|
|
|
|
}else{ |
|
|
|
|
|
str.join(',').split(',').forEach(element => { |
|
|
|
|
|
let str2=getDictLabel(type,element) |
|
|
|
|
|
stradd = stradd+str2+',' |
|
|
|
|
|
}) |
|
|
|
|
|
return stradd.substring(0,stradd.length-1) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
const message = useMessage() // 消息弹窗 |
|
|
const { t } = useI18n() // 国际化 |
|
|
const { t } = useI18n() // 国际化 |
|
|
|
|
|
|
|
@ -92,7 +125,7 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
// 列表头部按钮 |
|
|
const HeadButttondata = [ |
|
|
const HeadButttondata = [ |
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:businesstype:create'}), // 新增 |
|
|
// defaultButtons.defaultAddBtn({hasPermi:'wms:businesstype:create'}), // 新增 |
|
|
// defaultButtons.defaultImportBtn({hasPermi:'wms:businesstype:import'}), // 导入 |
|
|
// defaultButtons.defaultImportBtn({hasPermi:'wms:businesstype:import'}), // 导入 |
|
|
// defaultButtons.defaultExportBtn({hasPermi:'wms:businesstype:export'}), // 导出 |
|
|
// defaultButtons.defaultExportBtn({hasPermi:'wms:businesstype:export'}), // 导出 |
|
|
defaultButtons.defaultFreshBtn(null),//刷新 |
|
|
defaultButtons.defaultFreshBtn(null),//刷新 |
|
@ -127,13 +160,18 @@ const buttonBaseClick = (val, item) => { |
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const butttondata = [ |
|
|
const butttondata = [ |
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:businesstype:update'}), // 编辑 |
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:businesstype:update'}), // 编辑 |
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:businesstype:delete'}), // 删除 |
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:businesstype:delete'}), // 删除 |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'edit') { // 编辑 |
|
|
if (val == 'edit') { // 编辑 |
|
|
// const res = await BusinesstypeApi.getItempackaging(row.id) |
|
|
// const res = await BusinesstypeApi.getItempackaging(row.id) |
|
|
|
|
|
row.itemTypes=row.itemTypes.split(',') |
|
|
|
|
|
row.outLocationTypes = row.outLocationTypes.split(',') |
|
|
|
|
|
row.inLocationTypes = row.inLocationTypes.split(',') |
|
|
|
|
|
row.outInventoryStatuses = row.outInventoryStatuses.split(',') |
|
|
|
|
|
row.inInventoryStatuses = row.inInventoryStatuses.split(',') |
|
|
openForm('update', row) |
|
|
openForm('update', row) |
|
|
} else if (val == 'delete') { // 删除 |
|
|
} else if (val == 'delete') { // 删除 |
|
|
handleDelete(row.id) |
|
|
handleDelete(row.id) |
|
@ -159,6 +197,11 @@ const formsSuccess = async (formType,data) => { |
|
|
} |
|
|
} |
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
|
|
|
data.itemTypes = data.itemTypes.join(',') |
|
|
|
|
|
data.outLocationTypes = data.outLocationTypes.join(',') |
|
|
|
|
|
data.inLocationTypes = data.inLocationTypes.join(',') |
|
|
|
|
|
data.outInventoryStatuses = data.outInventoryStatuses.join(',') |
|
|
|
|
|
data.inInventoryStatuses = data.inInventoryStatuses.join(',') |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|
await BusinesstypeApi.createBusinesstype(data) |
|
|
await BusinesstypeApi.createBusinesstype(data) |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
|