Browse Source

器具申请代码开发

master_hella_20240701
chenfang 4 months ago
parent
commit
0a36cc83dd
  1. 83
      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

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

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

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

@ -34,7 +34,7 @@
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
@ -90,7 +90,7 @@ import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'ContainerMainRequest' })
defineOptions({ name: 'ContainerManage' })
const message = useMessage() //
const { t } = useI18n() //
@ -110,38 +110,54 @@ const { tableObject, tableMethods } = useTable({
/**
*
*/
if ( routeName.value == 'scrapContainerMainRequest') {
if ( routeName.value == 'ScrapContainerManage') {
tableObject.params = {
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'
importFileName.value = '器具报废申请'
} else if ( routeName.value == 'returnContainerMain') {
} else if ( routeName.value == 'ReturnContainerManage') {
tableObject.params = {
type:'RETURN'
}
// fromLocationCode.value = null
// toLocationCode.value = "NULL_CONTAIN"
ContainerMainRequest.allSchemas.formSchema.forEach(item=>{
if(item.field == 'type'){
item.value = "RETURN"
}});
businessType.value = 'ReturnContainerManage'
importFileName.value = '器具返回申请'
} else if ( routeName.value == 'moveContainerMainRequest') {
} else if ( routeName.value == 'MoveContainerManage') {
tableObject.params = {
type:'MOVE'
}
// fromLocationCode.value = null
// toLocationCode.value = null
ContainerMainRequest.allSchemas.formSchema.forEach(item=>{
if(item.field == 'type'){
item.value = "MOVE"
}});
businessType.value = 'MoveContainerManage'
importFileName.value = '器具转移申请'
} else if ( routeName.value == 'deliverContainerMainRequest') {
} else if ( routeName.value == 'DeliverContainerManage') {
tableObject.params = {
type: 'DELIVER',
}
// fromLocationCode.value = null
// toLocationCode.value = null
businessType.value = 'DeliverContainerMainRequest'
importFileName.value = '器具发运申请'
} else if( routeName.value == 'containerMainRequest'){
//
ContainerMainRequest.allSchemas.formSchema.forEach(item=>{
if(item.field == 'type'){
item.value = "DELIVER"
}});
businessType.value = 'DeliverContainerManage'
importFileName.value = '器具管理申请'
} else if( routeName.value == 'ContainerManage'){
businessType.value = 'ContainerManage'
importFileName.value = '器具管理申请'
}
@ -153,8 +169,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
nextTick(() => {
if (type == 'tableForm') {
if(formField == 'containerNumber') {
row['containerNumber'] = val[0]['code']
row['containerNumber'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
row['fromLocationCode'] = val[0]['locationCode']
row['fromInventoryStatus'] = val[0]['inventoryStatus']
}else if(formField == 'toLocationCode'){
row['toLocationCode'] = val[0]['code']
}else {
@ -172,8 +190,10 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
if(formField == 'containerNumber') {
setV['containerNumber'] = val[0]['itemCode']
setV['fromLocationNumber'] = val[0]['locationNumber']
setV['containerNumber'] = val[0]['code']
setV['uom'] = val[0]['uom']
}else if(formField == 'toLocationCode'){
setV['toLocationCode'] = val[0]['code']
}else {
setV[formField] = val[0][searchField]
}
@ -307,7 +327,73 @@ const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['ma
// -
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)
} else if (val == 'delete') { //
handleDelete(row.id)
@ -347,7 +433,7 @@ const flag = ref()
const submitForm = async (formType,data) => {
data.subList = tableData.value //
data.subList.forEach(item => {
if(item.qty == 0){
if(item.toQty == 0){
message.error(`到数量不能为0!`)
flag.value = true
return;
@ -355,6 +441,7 @@ const submitForm = async (formType,data) => {
})
try {
if (formType === 'create') {
data.businessType = businessType.value
await ContainerMainRequestApi.createContainerMainRequest(data)
message.success(t('common.createSuccess'))
} 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 Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'initialContainerMainRequest' })
defineOptions({ name: 'InitialContainerManage' })
const message = useMessage() //
const { t } = useI18n() //
@ -109,11 +109,15 @@ const { tableObject, tableMethods } = useTable({
/**
*
*/
if ( routeName.value == 'initialContainerMainRequest') {
if ( routeName.value == 'InitialContainerManage') {
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 = '器具初始化申请'
}
@ -126,6 +130,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
if(formField == 'containerNumber') {
row['containerNumber'] = val[0]['code']
row['uom'] = val[0]['uom']
row['toInventoryStatus'] = 'OK'
}else if(formField == 'toLocationCode'){
row['toLocationCode'] = val[0]['code']
}else {

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

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

Loading…
Cancel
Save