|
|
@ -244,6 +244,7 @@ const isShowPackageBtn = (row, val) => { |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
// defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']) }), // 完成 |
|
|
|
|
|
|
|
defaultButtons.mainApplyDecisionBtn({ |
|
|
|
hide: isShowMainButton(row, null), |
|
|
|
hasPermi: 'qms:inspection-recode-main:edit' |
|
|
@ -253,6 +254,10 @@ const butttondata = (row) => { |
|
|
|
hide: isShowMainButton(row, 'publish'), |
|
|
|
hasPermi: 'qms:inspection-recode-main:pub' |
|
|
|
}), // 发布 |
|
|
|
defaultButtons.mainListCloseBtn({ |
|
|
|
hide: isShowMainButton(row, null), |
|
|
|
hasPermi: 'qms:inspection-recode-main:close' |
|
|
|
}), // 关闭 |
|
|
|
defaultButtons.mainListPackageBtn({ hide: isShowPackageBtn(row, ['11']) }), // 包装 |
|
|
|
// defaultButtons.mainListJobExeBtn({ |
|
|
|
// hide:row.useDecision, |
|
|
@ -269,7 +274,9 @@ const useDecisionList = getStrDictOptions(DICT_TYPE.USAGE_DECISION) |
|
|
|
// const useDecisionList = InspectionRecordMain.allSchemas.formSchema.filter(item=>item.field == "useDecision") |
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'applyDecision') { |
|
|
|
if (val == 'mainClose') { |
|
|
|
handleOrderClose(row) |
|
|
|
} else if (val == 'applyDecision') { |
|
|
|
// 编辑 |
|
|
|
// 评估代码值是1,接收时候,使用决策下拉列表是全部合格 |
|
|
|
if (row.estimateCode == 1) { |
|
|
@ -366,7 +373,20 @@ const handleOrderPub = async (row: object) => { |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
|
|
|
|
/** 关闭按钮操作 */ |
|
|
|
const handleOrderClose = async (row: object) => { |
|
|
|
try { |
|
|
|
// 二次确认 |
|
|
|
await message.confirm(t('ts.是否关闭所选中数据?')) |
|
|
|
row.isPublished = true |
|
|
|
row.packageList = await InspectionRecordPackageApi.getInspectionRecordPackageList(row.id) |
|
|
|
await InspectionRecordMainApi.updateInspectionRecordMain(row) |
|
|
|
message.success(t('ts.关闭成功!')) |
|
|
|
await getList() |
|
|
|
} catch { |
|
|
|
row.isPublished = false |
|
|
|
} |
|
|
|
} |
|
|
|
//执行 |
|
|
|
|
|
|
|
const execute = async (type: string, row?: number) => { |
|
|
@ -445,33 +465,38 @@ const searchFormClick = (searchData) => { |
|
|
|
let isHave = searchData?.filters?.some((item) => item.column == 'inspectionType') |
|
|
|
if (!isHave) { |
|
|
|
if (route.name == 'inspectionRecordPurchase') { |
|
|
|
searchData.filters.push({ |
|
|
|
action: '==', |
|
|
|
column: 'inspectionType', |
|
|
|
value: '1' |
|
|
|
},{ |
|
|
|
action: '==', |
|
|
|
column: 'available', |
|
|
|
value: true |
|
|
|
}) |
|
|
|
} else if (route.name == 'inspectionRecordProduction') { |
|
|
|
searchData.filters.push({ |
|
|
|
action: '==', |
|
|
|
column: 'inspectionType', |
|
|
|
value: '4' |
|
|
|
},{ |
|
|
|
action: '==', |
|
|
|
column: 'available', |
|
|
|
value: true |
|
|
|
}) |
|
|
|
} else { |
|
|
|
searchData.filters.push( |
|
|
|
{ |
|
|
|
action: '==', |
|
|
|
column: 'inspectionType', |
|
|
|
value: '1' |
|
|
|
}, |
|
|
|
{ |
|
|
|
action: '==', |
|
|
|
column: 'available', |
|
|
|
value: true |
|
|
|
} |
|
|
|
) |
|
|
|
} else if (route.name == 'inspectionRecordProduction') { |
|
|
|
searchData.filters.push( |
|
|
|
{ |
|
|
|
action: '==', |
|
|
|
column: 'inspectionType', |
|
|
|
value: '4' |
|
|
|
}, |
|
|
|
{ |
|
|
|
action: '==', |
|
|
|
column: 'available', |
|
|
|
value: true |
|
|
|
} |
|
|
|
) |
|
|
|
} else { |
|
|
|
searchData.filters.push({ |
|
|
|
action: 'notIn', |
|
|
|
column: 'inspectionType', |
|
|
|
value: '1,4,11' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
action: 'notIn', |
|
|
|
column: 'inspectionType', |
|
|
|
value: '1,4,11' |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
tableObject.params = { |
|
|
|
isSearch: true, |
|
|
|