|
@ -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 { |
|
|