Browse Source

检验记录增加关闭按钮

hella_online_20240816
zhang_li 3 months ago
parent
commit
df485333ea
  1. 43
      src/views/qms/inspectionRecord/index.vue

43
src/views/qms/inspectionRecord/index.vue

@ -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,25 +465,31 @@ const searchFormClick = (searchData) => {
let isHave = searchData?.filters?.some((item) => item.column == 'inspectionType')
if (!isHave) {
if (route.name == 'inspectionRecordPurchase') {
searchData.filters.push({
searchData.filters.push(
{
action: '==',
column: 'inspectionType',
value: '1'
},{
},
{
action: '==',
column: 'available',
value: true
})
}
)
} else if (route.name == 'inspectionRecordProduction') {
searchData.filters.push({
searchData.filters.push(
{
action: '==',
column: 'inspectionType',
value: '4'
},{
},
{
action: '==',
column: 'available',
value: true
})
}
)
} else {
searchData.filters.push({
action: 'notIn',
@ -471,7 +497,6 @@ const searchFormClick = (searchData) => {
value: '1,4,11'
})
}
}
tableObject.params = {
isSearch: true,

Loading…
Cancel
Save