Browse Source

器具申请代码开发

master_hella_20240701
chenfang 6 months ago
parent
commit
0a36cc83dd
  1. 85
      src/views/wms/inventoryjobManage/containermanage/containerMainRequest/containerMainRequest.data.ts
  2. 129
      src/views/wms/inventoryjobManage/containermanage/containerMainRequest/index.vue
  3. 13
      src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/index.vue
  4. 7
      src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/initialContainerMainRequest.data.ts

85
src/views/wms/inventoryjobManage/containermanage/containerMainRequest/containerMainRequest.data.ts

@ -45,7 +45,25 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 100 width: 100
}, },
},{ }, {
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: true,
isForm: false,
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '类型', label: '类型',
field: 'type', field: 'type',
sort: 'custom', sort: 'custom',
@ -55,6 +73,11 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
isTable: true, isTable: true,
table: { table: {
width: 120 width: 120
},
form:{
componentProps:{
disabled: true,
}
} }
}, },
{ {
@ -308,6 +331,16 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
tableForm: {
disabled: true,
type: 'Select'
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled: true,
}
}
}, },
{ {
label: '目标库位代码', label: '目标库位代码',
@ -337,17 +370,61 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
{ {
label: '数量', label: '从库存状态',
field: 'qty', field: 'fromInventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true,
type: 'Select'
},
},
{
label: '到库存状态',
field: 'toInventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select'
},
},
// {
// label: '从数量',
// field: 'fromQty',
// sort: 'custom',
// tableForm: {
// disabled: true,
// },
// },
{
label: '到数量',
field: 'toQty',
sort: 'custom', sort: 'custom',
}, },
{ {
label: '计量单位', label: '计量单位',
field: 'uom', field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 120 width: 150
}, },
tableForm:{
disabled: true,
type: 'Select'
}
}, },
{ {
label: '备注', label: '备注',

129
src/views/wms/inventoryjobManage/containermanage/containerMainRequest/index.vue

@ -34,7 +34,7 @@
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -90,7 +90,7 @@ 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'
defineOptions({ name: 'ContainerMainRequest' }) defineOptions({ name: 'ContainerManage' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
@ -110,38 +110,54 @@ const { tableObject, tableMethods } = useTable({
/** /**
* *
*/ */
if ( routeName.value == 'scrapContainerMainRequest') { if ( routeName.value == 'ScrapContainerManage') {
tableObject.params = { tableObject.params = {
type:'SCRAP' type:'SCRAP'
} }
// toLocationCode.value = "SCRAP_CONTAIN" ContainerMainRequest.allSchemas.formSchema.forEach(item=>{
if(item.field == 'type'){
item.value = "SCRAP"
}});
ContainerDetailRequest.allSchemas.formSchema.forEach(item=>{
if(item.field == 'toInventoryStatus'){
item.value = "SCRAP"
}
});
businessType.value = 'ScrapContainerManage' businessType.value = 'ScrapContainerManage'
importFileName.value = '器具报废申请' importFileName.value = '器具报废申请'
} else if ( routeName.value == 'returnContainerMain') { } else if ( routeName.value == 'ReturnContainerManage') {
tableObject.params = { tableObject.params = {
type:'RETURN' type:'RETURN'
} }
// fromLocationCode.value = null ContainerMainRequest.allSchemas.formSchema.forEach(item=>{
// toLocationCode.value = "NULL_CONTAIN" if(item.field == 'type'){
item.value = "RETURN"
}});
businessType.value = 'ReturnContainerManage' businessType.value = 'ReturnContainerManage'
importFileName.value = '器具返回申请' importFileName.value = '器具返回申请'
} else if ( routeName.value == 'moveContainerMainRequest') { } else if ( routeName.value == 'MoveContainerManage') {
tableObject.params = { tableObject.params = {
type:'MOVE' type:'MOVE'
} }
// fromLocationCode.value = null ContainerMainRequest.allSchemas.formSchema.forEach(item=>{
// toLocationCode.value = null if(item.field == 'type'){
item.value = "MOVE"
}});
businessType.value = 'MoveContainerManage' businessType.value = 'MoveContainerManage'
importFileName.value = '器具转移申请' importFileName.value = '器具转移申请'
} else if ( routeName.value == 'deliverContainerMainRequest') { } else if ( routeName.value == 'DeliverContainerManage') {
tableObject.params = { tableObject.params = {
type: 'DELIVER', type: 'DELIVER',
} }
// fromLocationCode.value = null //
// toLocationCode.value = null ContainerMainRequest.allSchemas.formSchema.forEach(item=>{
businessType.value = 'DeliverContainerMainRequest' if(item.field == 'type'){
importFileName.value = '器具发运申请' item.value = "DELIVER"
} else if( routeName.value == 'containerMainRequest'){ }});
businessType.value = 'DeliverContainerManage'
importFileName.value = '器具管理申请'
} else if( routeName.value == 'ContainerManage'){
businessType.value = 'ContainerManage' businessType.value = 'ContainerManage'
importFileName.value = '器具管理申请' importFileName.value = '器具管理申请'
} }
@ -153,8 +169,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
nextTick(() => { nextTick(() => {
if (type == 'tableForm') { if (type == 'tableForm') {
if(formField == 'containerNumber') { if(formField == 'containerNumber') {
row['containerNumber'] = val[0]['code'] row['containerNumber'] = val[0]['itemCode']
row['uom'] = val[0]['uom'] row['uom'] = val[0]['uom']
row['fromLocationCode'] = val[0]['locationCode']
row['fromInventoryStatus'] = val[0]['inventoryStatus']
}else if(formField == 'toLocationCode'){ }else if(formField == 'toLocationCode'){
row['toLocationCode'] = val[0]['code'] row['toLocationCode'] = val[0]['code']
}else { }else {
@ -172,8 +190,10 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => { nextTick(() => {
const setV = {} const setV = {}
if(formField == 'containerNumber') { if(formField == 'containerNumber') {
setV['containerNumber'] = val[0]['itemCode'] setV['containerNumber'] = val[0]['code']
setV['fromLocationNumber'] = val[0]['locationNumber'] setV['uom'] = val[0]['uom']
}else if(formField == 'toLocationCode'){
setV['toLocationCode'] = val[0]['code']
}else { }else {
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
} }
@ -307,7 +327,73 @@ const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['ma
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'mainClose') { //
await message.confirm('确认要关闭吗?')
tableObject.loading = true
ContainerMainRequestApi.close(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainReAdd') { //
await message.confirm('确认要重新添加吗?')
tableObject.loading = true
ContainerMainRequestApi.reAdd(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainSubmit') { //
await message.confirm('确认要提交审批吗?')
tableObject.loading = true
ContainerMainRequestApi.submit(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainTurnDown') { //
await message.confirm('确认要驳回吗?')
tableObject.loading = true
ContainerMainRequestApi.refused(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainApprove') { //
await message.confirm('确认要审批通过吗?')
tableObject.loading = true
ContainerMainRequestApi.agree(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainHandle') { //
await message.confirm('确认要处理吗?')
tableObject.loading = true
ContainerMainRequestApi.handle(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'edit') { //
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
@ -347,7 +433,7 @@ const flag = ref()
const submitForm = async (formType,data) => { const submitForm = async (formType,data) => {
data.subList = tableData.value // data.subList = tableData.value //
data.subList.forEach(item => { data.subList.forEach(item => {
if(item.qty == 0){ if(item.toQty == 0){
message.error(`到数量不能为0!`) message.error(`到数量不能为0!`)
flag.value = true flag.value = true
return; return;
@ -355,6 +441,7 @@ const submitForm = async (formType,data) => {
}) })
try { try {
if (formType === 'create') { if (formType === 'create') {
data.businessType = businessType.value
await ContainerMainRequestApi.createContainerMainRequest(data) await ContainerMainRequestApi.createContainerMainRequest(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {

13
src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/index.vue

@ -90,7 +90,7 @@ 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'
defineOptions({ name: 'initialContainerMainRequest' }) defineOptions({ name: 'InitialContainerManage' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
@ -109,11 +109,15 @@ const { tableObject, tableMethods } = useTable({
/** /**
* *
*/ */
if ( routeName.value == 'initialContainerMainRequest') { if ( routeName.value == 'InitialContainerManage') {
tableObject.params = { tableObject.params = {
type:'INITIAL' type:'INITIAL',
} }
businessType.value = 'InitialContainerManageRequest' ContainerMainRequest.allSchemas.formSchema.forEach(item=>{
if(item.field == 'type'){
item.value = "INITIAL"
}});
businessType.value = 'InitialContainerManage'
importFileName.value = '器具初始化申请' importFileName.value = '器具初始化申请'
} }
@ -126,6 +130,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
if(formField == 'containerNumber') { if(formField == 'containerNumber') {
row['containerNumber'] = val[0]['code'] row['containerNumber'] = val[0]['code']
row['uom'] = val[0]['uom'] row['uom'] = val[0]['uom']
row['toInventoryStatus'] = 'OK'
}else if(formField == 'toLocationCode'){ }else if(formField == 'toLocationCode'){
row['toLocationCode'] = val[0]['code'] row['toLocationCode'] = val[0]['code']
}else { }else {

7
src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/initialContainerMainRequest.data.ts

@ -32,7 +32,6 @@ const queryParams = {
// 获取当前操作人的部门 // 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { ItemBasic } from '@/utils/disposition/formFields'
const userStore = useUserStore() const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到 // id 转str 否则form回显匹配不到
@ -63,7 +62,6 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
}, },
form: { form: {
value: '1',
componentProps: { componentProps: {
disabled: true disabled: true
} }
@ -79,6 +77,11 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
isTable: true, isTable: true,
table: { table: {
width: 120 width: 120
},
form:{
componentProps:{
disabled: true,
}
} }
}, },
{ {

Loading…
Cancel
Save