Browse Source

模具费用详情关闭重新打开按钮显示

intex_online20250311
张立 1 month ago
parent
commit
ef6d72fe33
  1. 49
      src/components/Detail/src/Detail.vue
  2. 8
      src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue

49
src/components/Detail/src/Detail.vue

@ -68,7 +68,7 @@
>
<!-- <template #action="{ row }">
<ButtonBase
:Butttondata="buttondata"
:Butttondata="buttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> -->
@ -95,7 +95,7 @@
</template>
<template #action="{ row }">
<ButtonBase
:Butttondata="buttondata"
:Butttondata="buttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
@ -111,7 +111,7 @@
>
<template #action="{ row }">
<ButtonBase
:Butttondata="buttondata"
:Butttondata="buttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
@ -544,6 +544,7 @@ const filterPermissionAnnexTable = ()=>{
const isShowDrawer = ref(false)
const detailLoading = ref(false)
const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : '')))
const buttondataTable = ref(props.buttondataTable)
if (props.isBasic == true) {
if (tabsList.value && tabsList.value.length > 0) {
@ -772,7 +773,7 @@ const masterParmas = ref({
const HeadButttondata = ref()
const HeadButttondataBackups = ref([])//
// -
const buttondata = ref()
// const buttondata = ref()
/** 表格弹窗 */
const initModel = (schema: FormSchema[], formModel: Recordable) => {
@ -875,13 +876,28 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
}
HeadButttondata.value = [...HeadButttondata.value,...props.otherHeadButttonData]
HeadButttondataBackups.value = [...HeadButttondata.value,...props.otherHeadButttonData]
let detailButtonEdit: any = []
// if (props.buttondataTable.length > 0) {
// // console.log(4445,props.buttondataTable)
// buttondataTable.value.forEach(item => {
// item.hide= isShowMainButton(row,item.showStatus)
// })
// }
// buttondata.value = [...detailButtonEdit,...detailButtonDelete,...buttondataTable.value]
} finally {
detailLoading.value = false
}
}
}
const buttondata = (row) => {
let detailButtonEdit: any = []
let detailButtonDelete: any = []
if (props.detailButtonIsShowEdit) {
//
detailButtonEdit = [
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row,props.detailButtonIsShowAddStatusArray),
hide: isShowMainButton(detailData.value,props.detailButtonIsShowAddStatusArray),
hasPermi: props.editHasPermi
})
]
@ -890,17 +906,26 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
//
detailButtonDelete = [
defaultButtons.mainListDeleteBtn({
hide: isShowMainButton(row,props.detailButtonIsShowAddStatusArray),
hide: isShowMainButton(detailData.value,props.detailButtonIsShowAddStatusArray),
hasPermi: props.deleteHasPermi
})
]
}
buttondata.value = [...detailButtonEdit,...detailButtonDelete,...props.buttondataTable]
} finally {
detailLoading.value = false
}
if (props.buttondataTable.length > 0) {
buttondataTable.value.forEach(item => {
if (item.field) {
item.hide = row[item.field] == '1' ? false : true
}
else {
item.hide = isShowMainButton(row,item.showStatus)
}
})
}
return [
...detailButtonEdit,
...detailButtonDelete,
...buttondataTable.value
]
}
const updateList =async ()=>{

8
src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue

@ -136,6 +136,8 @@ const buttondataTable =[{
label: '关闭',
name: 'close',
hide: false,
showStatus: ['0'],
field: 'isClose',
type: 'danger',
icon: '',
color: '',
@ -146,6 +148,8 @@ const buttondataTable =[{
name: 'reOpen',
hide: false,
type: 'primary',
showStatus: ['2'],
field: 'isOpen',
icon: '',
color: '',
hasPermi: '',
@ -254,10 +258,10 @@ const buttonBaseClick = (val, item) => {
const tableFormButton = async (val , row) => {
if (val == 'close') { //
await SuppliperMoldCostMainApi.close(row.id)
detailRef.value.getList();
detailRef.value.updateList();
}else if(val=='reOpen'){
await SuppliperMoldCostMainApi.reOpen(row.id)
detailRef.value.getList();
detailRef.value.updateList();
}
}

Loading…
Cancel
Save