|
@ -80,7 +80,7 @@ |
|
|
:apiDelete="PurchaseClaimRequestDetailApi.deletePurchaseClaimRequestDetail" |
|
|
:apiDelete="PurchaseClaimRequestDetailApi.deletePurchaseClaimRequestDetail" |
|
|
:detailButtonIsShowDelete="false" |
|
|
:detailButtonIsShowDelete="false" |
|
|
:detailButtonIsShowAdd="false" |
|
|
:detailButtonIsShowAdd="false" |
|
|
:detailButtonIsShowAddStatusArray="['1','2']" |
|
|
:detailButtonIsShowAddStatusArray="['1', '2']" |
|
|
:isChangeDetailDrawer="['2']" |
|
|
:isChangeDetailDrawer="['2']" |
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
@detailOpenForm="detailOpenForm" |
|
|
@detailOpenForm="detailOpenForm" |
|
@ -96,7 +96,7 @@ |
|
|
:mode="2" |
|
|
:mode="2" |
|
|
:extend="businessType" |
|
|
:extend="businessType" |
|
|
/> |
|
|
/> |
|
|
<BasicForm |
|
|
<BasicForm |
|
|
ref="detailFormRef" |
|
|
ref="detailFormRef" |
|
|
:isOpenSearchTable="true" |
|
|
:isOpenSearchTable="true" |
|
|
fieldTableColumn="itemCode" |
|
|
fieldTableColumn="itemCode" |
|
@ -154,18 +154,24 @@ const updataTableColumns = (val) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
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) => |
|
|
if(itemCodes.length>0){ |
|
|
tableData.value.find((item1) => item1['itemCode'] == item['itemCode']) |
|
|
itemCodes = itemCodes.map(item=>(item['itemCode'])) |
|
|
) |
|
|
|
|
|
if (itemCodes.length > 0) { |
|
|
|
|
|
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( |
|
|
if(val.length==0){ |
|
|
(item) => !tableData.value.find((item1) => item1['itemCode'] == item['itemCode']) |
|
|
|
|
|
) |
|
|
|
|
|
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'] |
|
@ -175,7 +181,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
if(formField === 'supplierCode'){ |
|
|
if (formField === 'supplierCode') { |
|
|
setV['supplierCode'] = val[0]['code'] |
|
|
setV['supplierCode'] = val[0]['code'] |
|
|
setV['supplierName'] = val[0]['name'] |
|
|
setV['supplierName'] = val[0]['name'] |
|
|
tableData.value = [] |
|
|
tableData.value = [] |
|
@ -192,9 +198,8 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
setV['remark'] = val[0]['remark'] |
|
|
setV['remark'] = val[0]['remark'] |
|
|
setV['uom'] = val[0]['customerUom'] |
|
|
setV['uom'] = val[0]['customerUom'] |
|
|
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,44 +301,46 @@ 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) |
|
|
message.success(t('common.updateSuccess')) |
|
|
.then(() => { |
|
|
tableObject.loading = false |
|
|
message.success(t('common.updateSuccess')) |
|
|
buttonBaseClick('refresh',null) |
|
|
tableObject.loading = false |
|
|
}).catch(err => { |
|
|
buttonBaseClick('refresh', null) |
|
|
tableObject.loading = false |
|
|
}) |
|
|
console.log(err) |
|
|
.catch((err) => { |
|
|
}) |
|
|
tableObject.loading = false |
|
|
} else if (val == 'mainReAdd') { // 重新添加 |
|
|
console.log(err) |
|
|
await message.confirm('确认要重新添加吗?') |
|
|
}) |
|
|
tableObject.loading = true |
|
|
} else if (val == 'mainReAdd') { |
|
|
PurchaseClaimRequestMainApi.reAddPurchaseClaimRequestMain(row.masterId).then(() => { |
|
|
// 重新添加 |
|
|
message.success(t('common.updateSuccess')) |
|
|
await message.confirm('确认要重新添加吗?') |
|
|
tableObject.loading = false |
|
|
tableObject.loading = true |
|
|
buttonBaseClick('refresh',null) |
|
|
PurchaseClaimRequestMainApi.reAddPurchaseClaimRequestMain(row.masterId) |
|
|
}).catch(err => { |
|
|
.then(() => { |
|
|
tableObject.loading = false |
|
|
message.success(t('common.updateSuccess')) |
|
|
console.log(err) |
|
|
tableObject.loading = false |
|
|
}) |
|
|
buttonBaseClick('refresh', null) |
|
|
} |
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 提交审批按钮操作 */ |
|
|
/** 提交审批按钮操作 */ |
|
|
const handleSub = async (masterId: number) => { |
|
|
const handleSub = async (masterId: number) => { |
|
|
try { |
|
|
try { |
|
@ -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 |
|
@ -561,7 +572,7 @@ const detailOpenForm = (type, row, masterParmas) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// 审批中的时候详情的编辑提交 |
|
|
// 审批中的时候详情的编辑提交 |
|
|
const submitFormDetail =async (formType,data) => { |
|
|
const submitFormDetail = async (formType, data) => { |
|
|
detailFormRef.value.formLoading = true |
|
|
detailFormRef.value.formLoading = true |
|
|
try { |
|
|
try { |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
@ -577,7 +588,6 @@ const submitFormDetail =async (formType,data) => { |
|
|
} catch { |
|
|
} catch { |
|
|
detailFormRef.value.formLoading = false |
|
|
detailFormRef.value.formLoading = false |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|