Browse Source

业务类型修改

master
李胜楠 1 year ago
parent
commit
c9d6950963
  1. 47
      src/views/wms/basicDataManage/documentSetting/businesstype/businesstype.data.ts
  2. 49
      src/views/wms/basicDataManage/documentSetting/businesstype/index.vue

47
src/views/wms/basicDataManage/documentSetting/businesstype/businesstype.data.ts

@ -19,15 +19,24 @@ export const Businesstype = useCrudSchemas(reactive<CrudSchema[]>([
fixed: 'left'
},
isSearch: true,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '描述',
@ -47,6 +56,12 @@ export const Businesstype = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 180
},
form: {
component:'Select',
componentProps: {
multiple: true,
},
}
},
{
label: '可用物品状态范围',
@ -58,12 +73,6 @@ export const Businesstype = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 180
},
form: {
component: 'SelectV2',
componentProps: {
multiple: true
}
}
},
{
label: '出库库位类型范围',
@ -75,6 +84,12 @@ export const Businesstype = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 180
},
form: {
component:'Select',
componentProps: {
multiple: true,
},
}
},
{
label: '入库库位类型范围',
@ -86,6 +101,12 @@ export const Businesstype = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 180
},
form: {
component:'Select',
componentProps: {
multiple: true,
},
}
},
{
label: '出库库区范围',
@ -135,6 +156,12 @@ export const Businesstype = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 180
},
form: {
component:'Select',
componentProps: {
multiple: true,
},
}
},
{
label: '入库库存状态范围',
@ -146,6 +173,12 @@ export const Businesstype = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 180
},
form: {
component:'Select',
componentProps: {
multiple: true,
},
}
},
{
label: '出库事务类型',

49
src/views/wms/basicDataManage/documentSetting/businesstype/index.vue

@ -35,13 +35,28 @@
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</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>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
@success="formsSuccess"
:rules="BusinesstypeRules"
:formAllSchemas="Businesstype.allSchemas"
:apiUpdate="BusinesstypeApi.updateBusinesstype"
@ -59,6 +74,7 @@
<script setup lang="ts">
import download from '@/utils/download'
import { getDictLabel,DICT_TYPE } from '@/utils/dict'
import * as BusinesstypeApi from '@/api/wms/businesstype'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Businesstype, BusinesstypeRules } from './businesstype.data'
@ -70,6 +86,23 @@ import Detail from '@/components/Detail/src/Detail.vue'
//
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 { t } = useI18n() //
@ -92,7 +125,7 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:businesstype:create'}), //
// defaultButtons.defaultAddBtn({hasPermi:'wms:businesstype:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:businesstype:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'wms:businesstype:export'}), //
defaultButtons.defaultFreshBtn(null),//
@ -127,13 +160,18 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:businesstype:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:businesstype:delete'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:businesstype:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// 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)
} else if (val == 'delete') { //
handleDelete(row.id)
@ -159,6 +197,11 @@ const formsSuccess = async (formType,data) => {
}
if(data.activeTime==0)data.activeTime = 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') {
await BusinesstypeApi.createBusinesstype(data)
message.success(t('common.createSuccess'))

Loading…
Cancel
Save