|
@ -155,17 +155,23 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
nextTick(async () => { |
|
|
nextTick(async () => { |
|
|
if (type == 'tableForm') { |
|
|
if (type == 'tableForm') { |
|
|
if (formField == 'itemCode') { |
|
|
if (formField == 'itemCode') { |
|
|
let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) |
|
|
let itemCodes = val.filter((item) => |
|
|
|
|
|
tableData.value.find((item1) => item1['itemCode'] == item['itemCode']) |
|
|
|
|
|
) |
|
|
if (itemCodes.length > 0) { |
|
|
if (itemCodes.length > 0) { |
|
|
itemCodes = itemCodes.map(item=>(item['itemCode'])) |
|
|
itemCodes = itemCodes.map((item) => item['itemCode']) |
|
|
message.warning(`物料${itemCodes.join(',')}已经存在`) |
|
|
message.warning(`物料${itemCodes.join(',')}已经存在`) |
|
|
} |
|
|
} |
|
|
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) |
|
|
val = val.filter( |
|
|
|
|
|
(item) => !tableData.value.find((item1) => item1['itemCode'] == item['itemCode']) |
|
|
|
|
|
) |
|
|
if (val.length == 0) { |
|
|
if (val.length == 0) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
let newVal = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) |
|
|
let newVal = val.filter( |
|
|
newVal.forEach(item=>{ |
|
|
(item) => !tableData.value.find((item1) => item1['itemCode'] == item['itemCode']) |
|
|
|
|
|
) |
|
|
|
|
|
newVal.forEach((item) => { |
|
|
let tfk = JSON.parse(JSON.stringify(tableFormKeys)) |
|
|
let tfk = JSON.parse(JSON.stringify(tableFormKeys)) |
|
|
tfk['itemCode'] = item['itemCode'] |
|
|
tfk['itemCode'] = item['itemCode'] |
|
|
tfk['itemName'] = item['itemName'] |
|
|
tfk['itemName'] = item['itemName'] |
|
@ -194,7 +200,6 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
if (formField == 'itemCode') { |
|
|
if (formField == 'itemCode') { |
|
|
setV['itemName'] = val[0]['itemName'] |
|
|
setV['itemName'] = val[0]['itemName'] |
|
|
setV['uom'] = val[0]['supplierUom'] |
|
|
setV['uom'] = val[0]['supplierUom'] |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
formRef.setValues(setV) |
|
|
formRef.setValues(setV) |
|
|
}) |
|
|
}) |
|
@ -277,9 +282,14 @@ const butttondata = (row, $index) => { |
|
|
hide: isShowMainButton(row, ['1']), |
|
|
hide: isShowMainButton(row, ['1']), |
|
|
hasPermi: 'wms:purchaseClaimRequest:update' |
|
|
hasPermi: 'wms:purchaseClaimRequest:update' |
|
|
}), // 编辑 |
|
|
}), // 编辑 |
|
|
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3']),hasPermi:'wms:purchaseClaimRequest:close'}), // 关闭 |
|
|
defaultButtons.mainListCloseBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['1', '2', '3']), |
|
|
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:purchaseClaimRequest:reAdd'}), // 重新添加 |
|
|
hasPermi: 'wms:purchaseClaimRequest:close' |
|
|
|
|
|
}), // 关闭 |
|
|
|
|
|
defaultButtons.mainListReAddBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['4', '5']), |
|
|
|
|
|
hasPermi: 'wms:purchaseClaimRequest:reAdd' |
|
|
|
|
|
}) // 重新添加 |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -291,43 +301,45 @@ const buttonTableClick = async (val, row) => { |
|
|
} else if (val == 'mainPlanSub') { |
|
|
} else if (val == 'mainPlanSub') { |
|
|
// 提交审批 |
|
|
// 提交审批 |
|
|
handleSub(row.masterId) |
|
|
handleSub(row.masterId) |
|
|
} |
|
|
} else if (val == 'mainPlanApp') { |
|
|
else if (val == 'mainPlanApp') { |
|
|
|
|
|
// 审批通过 |
|
|
// 审批通过 |
|
|
handleAgree(row.masterId) |
|
|
handleAgree(row.masterId) |
|
|
} |
|
|
} else if (val == 'mainPlanTur') { |
|
|
else if (val == 'mainPlanTur') { |
|
|
|
|
|
// 审批驳回 |
|
|
// 审批驳回 |
|
|
handleReject(row.masterId) |
|
|
handleReject(row.masterId) |
|
|
} |
|
|
} else if (val == 'delete') { |
|
|
else if (val == 'delete') { |
|
|
|
|
|
// 删除 |
|
|
// 删除 |
|
|
handleDelete(row.masterId) |
|
|
handleDelete(row.masterId) |
|
|
}else if (val == 'mainClose') { // 关闭 |
|
|
} else if (val == 'mainClose') { |
|
|
|
|
|
// 关闭 |
|
|
await message.confirm('确认要关闭吗?') |
|
|
await message.confirm('确认要关闭吗?') |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
PurchaseClaimRequestMainApi.closePurchaseClaimRequestMain(row.masterId).then(() => { |
|
|
PurchaseClaimRequestMainApi.closePurchaseClaimRequestMain(row.masterId) |
|
|
|
|
|
.then(() => { |
|
|
message.success(t('common.updateSuccess')) |
|
|
message.success(t('common.updateSuccess')) |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
buttonBaseClick('refresh', null) |
|
|
buttonBaseClick('refresh', null) |
|
|
}).catch(err => { |
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (val == 'mainReAdd') { |
|
|
|
|
|
// 重新添加 |
|
|
|
|
|
await message.confirm('确认要重新添加吗?') |
|
|
|
|
|
tableObject.loading = true |
|
|
|
|
|
PurchaseClaimRequestMainApi.reAddPurchaseClaimRequestMain(row.masterId) |
|
|
|
|
|
.then(() => { |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
buttonBaseClick('refresh', null) |
|
|
|
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
console.log(err) |
|
|
console.log(err) |
|
|
}) |
|
|
}) |
|
|
} else if (val == 'mainReAdd') { // 重新添加 |
|
|
|
|
|
await message.confirm('确认要重新添加吗?') |
|
|
|
|
|
tableObject.loading = true |
|
|
|
|
|
PurchaseClaimRequestMainApi.reAddPurchaseClaimRequestMain(row.masterId).then(() => { |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
buttonBaseClick('refresh',null) |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 提交审批按钮操作 */ |
|
|
/** 提交审批按钮操作 */ |
|
|
const handleSub = async (masterId: number) => { |
|
|
const handleSub = async (masterId: number) => { |
|
@ -383,20 +395,19 @@ const handleReject = async (masterId: number) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const formRef = ref() |
|
|
const formRef = ref() |
|
|
const openForm = async (type: string, row?: any) => { |
|
|
const openForm = async (type: string, row?: any) => { |
|
|
tableData.value = [] // 重置明细数据 |
|
|
tableData.value = [] // 重置明细数据 |
|
|
if (row?.id) { |
|
|
if (row?.id) { |
|
|
PurchaseClaimRequestMain.allSchemas.formSchema.forEach(item => { |
|
|
PurchaseClaimRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
if (item.field == 'supplierCode') { |
|
|
if (item.field == 'supplierCode') { |
|
|
item.componentProps.isSearchList = false |
|
|
item.componentProps.isSearchList = false |
|
|
item.componentProps.disabled = true |
|
|
item.componentProps.disabled = true |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
PurchaseClaimRequestMain.allSchemas.formSchema.forEach(item => { |
|
|
PurchaseClaimRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
if (item.field == 'supplierCode') { |
|
|
if (item.field == 'supplierCode') { |
|
|
item.componentProps.isSearchList = true |
|
|
item.componentProps.isSearchList = true |
|
|
item.componentProps.disabled = false |
|
|
item.componentProps.disabled = false |
|
@ -577,7 +588,6 @@ const submitFormDetail =async (formType,data) => { |
|
|
} catch { |
|
|
} catch { |
|
|
detailFormRef.value.formLoading = false |
|
|
detailFormRef.value.formLoading = false |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|