|
|
@ -76,7 +76,8 @@ |
|
|
|
:apiDelete="SparePartsInLocationDetailApi.deleteSparePartsInLocationDetail" |
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
:isShowAddBtn="true" |
|
|
|
:detailButtonIsShowAdd="false" |
|
|
|
:detailButtonIsShowAdd="true" |
|
|
|
:detailButtonIsShowAddStatusArray="['0']" |
|
|
|
/> |
|
|
|
<!-- 审核页面 --> |
|
|
|
<!-- <AudiForm ref="audiFormRef" @success="handleApprove"/> --> |
|
|
@ -85,6 +86,7 @@ |
|
|
|
:rules="SparePartsInLocationMainRules" |
|
|
|
:formAllSchemas="SparePartsInLocationExamine.allSchemas" |
|
|
|
@submitForm="approveSparePartsInLocation" |
|
|
|
:isCol="false" |
|
|
|
/> |
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm |
|
|
@ -134,23 +136,22 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
|
nextTick(() => { |
|
|
|
const setV = {} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
console.log(11, val[0]) |
|
|
|
if (type == 'tableForm') { |
|
|
|
if (formField == 'locationCode') { |
|
|
|
// row['sparePartsCode'] = val[0].itemNumber |
|
|
|
row['locationCode'] = val[0].code |
|
|
|
row['areaCode'] = val[0].areaCode |
|
|
|
row['sparePartsCode'] = val[0].sparePartsCode |
|
|
|
row['locationCode'] = val[0].locationNumber |
|
|
|
row['areaCode'] = val[0].areaNumber |
|
|
|
row['sparePartsCode'] = val[0].itemNumber |
|
|
|
row['currentQty'] = val[0].qty |
|
|
|
row['isRadeIn'] = val[0].isRadeIn |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (formField == 'locationCode') { |
|
|
|
setV['locationCode'] = val[0].code |
|
|
|
setV['areaCode'] = val[0].areaCode |
|
|
|
setV['sparePartsCode'] = val[0].sparePartsCode |
|
|
|
setV['locationCode'] = val[0].locationNumber |
|
|
|
setV['areaCode'] = val[0].areaNumber |
|
|
|
setV['sparePartsCode'] = val[0].itemNumber |
|
|
|
setV['currentQty'] = val[0].qty |
|
|
|
setV['isRadeIn'] = val[0].isRadeIn |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
formRef.setValues(setV) |
|
|
@ -162,11 +163,11 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
|
nextTick(async () => { |
|
|
|
const setV = {} |
|
|
|
if (formField == 'locationCode') { |
|
|
|
setV['locationCode'] = val[0].code |
|
|
|
setV['areaCode'] = val[0].areaCode |
|
|
|
setV['sparePartsCode'] = val[0].sparePartsCode |
|
|
|
setV['currentQty'] = val[0].qty |
|
|
|
setV['isRadeIn'] = val[0].isRadeIn |
|
|
|
setV['locationCode'] = val[0].locationNumber |
|
|
|
setV['areaCode'] = val[0].areaNumber |
|
|
|
setV['sparePartsCode'] = val[0].itemNumber |
|
|
|
setV['currentQty'] = val[0].qty |
|
|
|
setV['isRadeIn'] = val[0].isRadeIn |
|
|
|
} |
|
|
|
formRef.setValues(setV) |
|
|
|
}) |
|
|
@ -183,9 +184,9 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
defaultButtons.defaultAddBtn({hasPermi:'eam:spare-parts-in-location-main:create'}), // 新增 |
|
|
|
defaultButtons.defaultImportBtn({hasPermi:'eam:spare-parts-in-location-main:import'}), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:'eam:spare-parts-in-location-main:export'}), // 导出 |
|
|
|
defaultButtons.defaultAddBtn({ hasPermi: 'eam:spare-parts-in-location-main:create' }), // 新增 |
|
|
|
defaultButtons.defaultImportBtn({ hasPermi: 'eam:spare-parts-in-location-main:import' }), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'eam:spare-parts-in-location-main:export' }), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null) // 设置 |
|
|
@ -233,12 +234,34 @@ const isShowMainButton = (row, val) => { |
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListEditBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:spare-parts-in-location-main:update' }), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:spare-parts-in-location-main:delete' }), // 删除 |
|
|
|
defaultButtons.mainListAuditingBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:spare-parts-in-location-main:examine' }), //审核 |
|
|
|
defaultButtons.mainListRevokeBtn({hide: isShowStatusButton(row, ['3']), hasPermi: 'eam:spare-parts-in-location-main:cancel'}), // 撤回 |
|
|
|
defaultButtons.mainListTurnDownBtn({hide: isShowStatusButton(row, ['3']), hasPermi: 'eam:spare-parts-in-location-main:rejecte' }), //驳回 |
|
|
|
defaultButtons.mainListApproveBtn({hide: isShowStatusButton(row, ['3']), hasPermi: 'eam:spare-parts-in-location-main:approve' }), //审批通过 |
|
|
|
defaultButtons.mainListEditBtn({ |
|
|
|
hide: isShowStatusButton(row, ['0']), |
|
|
|
hasPermi: 'eam:spare-parts-in-location-main:update' |
|
|
|
}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({ |
|
|
|
hide: isShowStatusButton(row, ['0']), |
|
|
|
hasPermi: 'eam:spare-parts-in-location-main:delete' |
|
|
|
}), // 删除 |
|
|
|
defaultButtons.mainListAuditingBtn({ |
|
|
|
hide: isShowStatusButton(row, ['0']), |
|
|
|
hasPermi: 'eam:spare-parts-in-location-main:examine' |
|
|
|
}), //审核 |
|
|
|
defaultButtons.mainListRevokeBtn({ |
|
|
|
hide: isShowStatusButton(row, ['3']), |
|
|
|
hasPermi: 'eam:spare-parts-in-location-main:cancel' |
|
|
|
}), // 撤回 |
|
|
|
defaultButtons.mainListTurnDownBtn({ |
|
|
|
hide: isShowStatusButton(row, ['3']), |
|
|
|
hasPermi: 'eam:spare-parts-in-location-main:rejecte' |
|
|
|
}), //驳回 |
|
|
|
defaultButtons.mainListApproveBtn({ |
|
|
|
hide: isShowStatusButton(row, ['3']), |
|
|
|
hasPermi: 'eam:spare-parts-in-location-main:approve' |
|
|
|
}), //审批通过 |
|
|
|
defaultButtons.mainListFinishBtn({ |
|
|
|
hide: isShowStatusButton(row, ['4']), |
|
|
|
hasPermi: 'eam:spare-parts-in-location-main:finish' |
|
|
|
}) //完成 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
@ -247,29 +270,28 @@ const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { |
|
|
|
// 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} |
|
|
|
else if (val == 'auditing') { |
|
|
|
} else if (val == 'auditing') { |
|
|
|
//审核 |
|
|
|
handleSubmitExamine(row.id) |
|
|
|
} |
|
|
|
else if (val == 'mainTurnDown') { |
|
|
|
} else if (val == 'mainTurnDown') { |
|
|
|
//驳回 |
|
|
|
handleRejecte(row.id) |
|
|
|
} |
|
|
|
else if (val == 'mainApprove') { |
|
|
|
} else if (val == 'mainApprove') { |
|
|
|
//审核通过 |
|
|
|
formRefApproved.value.open('update',row,{masterId:row.id},'auditing') |
|
|
|
} |
|
|
|
else if (val == 'revoke') { // 撤回 |
|
|
|
formRefApproved.value.open('update', row, { masterId: row.id }, 'auditing') |
|
|
|
} else if (val == 'revoke') { |
|
|
|
// 撤回 |
|
|
|
handleCancel(row.id) |
|
|
|
} |
|
|
|
else if (val == 'delete') { |
|
|
|
} else if (val == 'finish') { |
|
|
|
// 完成 |
|
|
|
handleFinish(row.id) |
|
|
|
} else if (val == 'delete') { |
|
|
|
// 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const isShowStatusButton = (row,val) => { |
|
|
|
const isShowStatusButton = (row, val) => { |
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
|
return false |
|
|
|
} else { |
|
|
@ -343,6 +365,11 @@ const submitForm = async (formType, data) => { |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
console.log(formRef.value) |
|
|
|
formRef.value.formLoading = true |
|
|
|
let isHave = data.subList.some(item=>item.applyQty>item.currentQty) |
|
|
|
if(isHave){ |
|
|
|
message.warning('申领数量不能大于库存数量') |
|
|
|
return |
|
|
|
} |
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|
await SparePartsInLocationMainApi.createSparePartsInLocationMain(data) |
|
|
@ -386,7 +413,7 @@ const searchFormClick = (searchData) => { |
|
|
|
} |
|
|
|
// 审核 |
|
|
|
const handleSubmitExamine = async (id: number) => { |
|
|
|
await message.delConfirm(t('ts.是否提交审核?')); |
|
|
|
await message.delConfirm(t('ts.是否提交审核?')) |
|
|
|
try { |
|
|
|
await SparePartsInLocationMainApi.submitExamineSparePartsInLocation(id) |
|
|
|
message.success(t('ts.提交审批成功!')) |
|
|
@ -396,40 +423,49 @@ const handleSubmitExamine = async (id: number) => { |
|
|
|
} |
|
|
|
/** 撤回按钮操作 */ |
|
|
|
const handleCancel = async (id: number) => { |
|
|
|
await message.delConfirm(t('ts.是否撤回所选中数据?')); |
|
|
|
await message.delConfirm(t('ts.是否撤回所选中数据?')) |
|
|
|
try { |
|
|
|
await SparePartsInLocationMainApi.cancelSparePartsInLocation(id) |
|
|
|
message.success(t('ts.撤回成功')) |
|
|
|
message.success(t('ts.撤回成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
|
|
|
|
//审核驳回按钮 |
|
|
|
const handleRejecte=async(id: number)=> { |
|
|
|
await message.delConfirm(t('ts.是否驳回所选中数据?')); |
|
|
|
const handleRejecte = async (id: number) => { |
|
|
|
await message.delConfirm(t('ts.是否驳回所选中数据?')) |
|
|
|
try { |
|
|
|
await SparePartsInLocationMainApi.rejectSparePartsInLocation(id) |
|
|
|
message.success(t('ts.驳回成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
message.success(t('ts.驳回成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
// 审核通过 |
|
|
|
const approveSparePartsInLocation =async(formType,data)=> { |
|
|
|
console.log(data) |
|
|
|
const approveSparePartsInLocation = async (formType, data) => { |
|
|
|
try { |
|
|
|
// const params = { |
|
|
|
// id: |
|
|
|
// } |
|
|
|
await SparePartsInLocationMainApi.approveSparePartsInLocation(data) |
|
|
|
message.success(t('ts.审核通过!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
message.success(t('ts.审核通过!')) |
|
|
|
// 刷新列表 |
|
|
|
formRefApproved.value.dialogVisible = false |
|
|
|
await getList() |
|
|
|
} finally { |
|
|
|
formRefApproved.value.formLoading = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//审核驳回按钮 |
|
|
|
const handleFinish = async (id: number) => { |
|
|
|
await message.delConfirm(t('ts.是否完成所选中数据?')) |
|
|
|
try { |
|
|
|
await SparePartsInLocationMainApi.finishSparePartsInLocation(id) |
|
|
|
message.success(t('ts.完成成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|