|
|
@ -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,14 +433,15 @@ 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; |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|
data.businessType = businessType.value |
|
|
|
await ContainerMainRequestApi.createContainerMainRequest(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
} else { |
|
|
|