|
@ -69,7 +69,7 @@ |
|
|
:countScopeType="countScopeType" |
|
|
:countScopeType="countScopeType" |
|
|
:key="updateKey" |
|
|
:key="updateKey" |
|
|
> |
|
|
> |
|
|
<template #action="{ row }"> |
|
|
<template #action="{ row }"> |
|
|
<ButtonBase |
|
|
<ButtonBase |
|
|
:Butttondata="buttondata" |
|
|
:Butttondata="buttondata" |
|
|
@button-base-click="buttonTableClick($event, row)" |
|
|
@button-base-click="buttonTableClick($event, row)" |
|
@ -131,7 +131,6 @@ import DetailTable from '@/components/DetailTable/src/DetailTable.vue' |
|
|
|
|
|
|
|
|
defineOptions({ name: 'Detail' }) |
|
|
defineOptions({ name: 'Detail' }) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
const message = useMessage() // 消息弹窗 |
|
|
const { t } = useI18n() // 国际化 |
|
|
const { t } = useI18n() // 国际化 |
|
|
|
|
|
|
|
@ -139,7 +138,7 @@ const route = useRoute() // 路由信息 |
|
|
const routeName = ref() |
|
|
const routeName = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail' |
|
|
routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail' |
|
|
const updateKey = ref(0); |
|
|
const updateKey = ref(0) |
|
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
const props = defineProps({ |
|
|
// 标签参数 |
|
|
// 标签参数 |
|
@ -231,7 +230,7 @@ const props = defineProps({ |
|
|
type: Array, |
|
|
type: Array, |
|
|
required: false, |
|
|
required: false, |
|
|
default: null |
|
|
default: null |
|
|
}, |
|
|
} |
|
|
}) |
|
|
}) |
|
|
const isShowDrawer = ref(false) |
|
|
const isShowDrawer = ref(false) |
|
|
const detailLoading = ref(false) |
|
|
const detailLoading = ref(false) |
|
@ -343,18 +342,27 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
getFileList() |
|
|
getFileList() |
|
|
getChangeRecordList() |
|
|
getChangeRecordList() |
|
|
// 判断详情新增按钮是否显示 |
|
|
// 判断详情新增按钮是否显示 |
|
|
if(routeName.value.indexOf('Job') > -1){ |
|
|
if (routeName.value.indexOf('Job') > -1) { |
|
|
HeadButttondata.value = [ |
|
|
HeadButttondata.value = [ |
|
|
defaultButtons.defaultFilterBtn(null) // 筛选 |
|
|
defaultButtons.defaultFilterBtn(null) // 筛选 |
|
|
] |
|
|
] |
|
|
}else{ |
|
|
} else { |
|
|
HeadButttondata.value = [ |
|
|
HeadButttondata.value = [ |
|
|
defaultButtons.defaultAddBtn({ |
|
|
defaultButtons.defaultAddBtn({ |
|
|
hide: isShowMainButton(row, ['1']) |
|
|
hide: isShowMainButton(row, ['1']) |
|
|
}), // 新增 |
|
|
}), // 新增 |
|
|
defaultButtons.defaultFilterBtn(null) // 筛选 |
|
|
defaultButtons.defaultFilterBtn(null) // 筛选 |
|
|
] |
|
|
] |
|
|
|
|
|
//盘点计划详情筛选 |
|
|
|
|
|
if (props.fromeWhere == 'countPlan') { |
|
|
|
|
|
HeadButttondata.value = [ |
|
|
|
|
|
defaultButtons.defaultAddBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['1']) |
|
|
|
|
|
}) // 新增 |
|
|
|
|
|
] |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 动态显示操作列按钮 |
|
|
// 动态显示操作列按钮 |
|
|
buttondata.value = [ |
|
|
buttondata.value = [ |
|
|
defaultButtons.mainListEditBtn({ |
|
|
defaultButtons.mainListEditBtn({ |
|
@ -391,7 +399,6 @@ const getChangeRecordList = async () => { |
|
|
changeRecordData.changeRecordList = await RemarkApi.getChangeRecordPage(remarksData.data) |
|
|
changeRecordData.changeRecordList = await RemarkApi.getChangeRecordPage(remarksData.data) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const tableObjectRef = ref() |
|
|
const tableObjectRef = ref() |
|
|
const tableMethodsRef = ref() |
|
|
const tableMethodsRef = ref() |
|
|
const detailAllSchemasRef = ref() |
|
|
const detailAllSchemasRef = ref() |
|
@ -457,17 +464,13 @@ const buttonTableClick = async (val, row) => { |
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const formRef = ref() |
|
|
const formRef = ref() |
|
|
const openForm = async (type: string, row?: number) => { |
|
|
const openForm = async (type: string, row?: number) => { |
|
|
console.log(row) |
|
|
|
|
|
if(props.fromeWhere=='countPlan'){ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
formRef.value.open(type, row, masterParmas.value) |
|
|
formRef.value.open(type, row, masterParmas.value) |
|
|
} |
|
|
} |
|
|
// form 提交 |
|
|
// form 提交 |
|
|
const submitForm = async (formType, data) => { |
|
|
const submitForm = async (formType, data) => { |
|
|
try { |
|
|
try { |
|
|
// 子表新增编辑校验 如果业务需要子表提交校验 需在主页详情组件添加 detailValidate 参数及方法 |
|
|
// 子表新增编辑校验 如果业务需要子表提交校验 需在主页详情组件添加 detailValidate 参数及方法 |
|
|
const rs = await props.detailValidate?props.detailValidate(data):true |
|
|
const rs = (await props.detailValidate) ? props.detailValidate(data) : true |
|
|
if (!rs) return |
|
|
if (!rs) return |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|
await props.apiCreate(data) |
|
|
await props.apiCreate(data) |
|
@ -478,8 +481,8 @@ const submitForm = async (formType, data) => { |
|
|
} |
|
|
} |
|
|
formRef.value.dialogVisible = false |
|
|
formRef.value.dialogVisible = false |
|
|
// 刷新当前列表 |
|
|
// 刷新当前列表 |
|
|
await getList() |
|
|
await getList() |
|
|
updateKey.value += 1; |
|
|
updateKey.value += 1 |
|
|
} finally { |
|
|
} finally { |
|
|
formRef.value.formLoading = false |
|
|
formRef.value.formLoading = false |
|
|
} |
|
|
} |
|
@ -490,7 +493,12 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
emit('searchTableSuccessDetail', formField, searchField, val, formRef) |
|
|
emit('searchTableSuccessDetail', formField, searchField, val, formRef) |
|
|
} |
|
|
} |
|
|
// 传递给父类 |
|
|
// 传递给父类 |
|
|
const emit = defineEmits(['searchTableSuccessDetail', 'changeTabs','selectChangeDetail','detailOpenForm']) |
|
|
const emit = defineEmits([ |
|
|
|
|
|
'searchTableSuccessDetail', |
|
|
|
|
|
'changeTabs', |
|
|
|
|
|
'selectChangeDetail', |
|
|
|
|
|
'detailOpenForm' |
|
|
|
|
|
]) |
|
|
/** 删除按钮操作 */ |
|
|
/** 删除按钮操作 */ |
|
|
const handleDelete = async (id: number) => { |
|
|
const handleDelete = async (id: number) => { |
|
|
try { |
|
|
try { |
|
@ -501,27 +509,27 @@ const handleDelete = async (id: number) => { |
|
|
message.success(t('common.delSuccess')) |
|
|
message.success(t('common.delSuccess')) |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
updateKey.value += 1; |
|
|
updateKey.value += 1 |
|
|
} catch {} |
|
|
} catch {} |
|
|
} |
|
|
} |
|
|
// 筛选提交 |
|
|
// 筛选提交 |
|
|
const searchFormClick =async (searchData) => { |
|
|
const searchFormClick = async (searchData) => { |
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
getListApi: props.apiPage // 分页接口 |
|
|
getListApi: props.apiPage // 分页接口 |
|
|
}) |
|
|
}) |
|
|
tableObject.params = { |
|
|
tableObject.params = { |
|
|
isSearch: true, |
|
|
isSearch: true, |
|
|
filters: searchData.filters |
|
|
filters: searchData.filters |
|
|
? searchData.filters |
|
|
? searchData.filters |
|
|
: [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }] |
|
|
: [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }] |
|
|
} |
|
|
} |
|
|
detailAllSchemasRef.value = props.detailAllSchemas |
|
|
detailAllSchemasRef.value = props.detailAllSchemas |
|
|
tableObjectRef.value = tableObject |
|
|
tableObjectRef.value = tableObject |
|
|
tableMethodsRef.value = tableMethods |
|
|
tableMethodsRef.value = tableMethods |
|
|
tableObjectRef.value.tableList = [] |
|
|
tableObjectRef.value.tableList = [] |
|
|
const { getList } = tableMethods |
|
|
const { getList } = tableMethods |
|
|
await getList() |
|
|
await getList() |
|
|
updateKey.value += 1; |
|
|
updateKey.value += 1 |
|
|
// tableObjectRef.value.params = { |
|
|
// tableObjectRef.value.params = { |
|
|
// isSearch: true, |
|
|
// isSearch: true, |
|
|
// filters: searchData.filters |
|
|
// filters: searchData.filters |
|
@ -536,7 +544,7 @@ const selectChangeDetail = (field, val) => { |
|
|
} |
|
|
} |
|
|
//监视属性 |
|
|
//监视属性 |
|
|
watch( |
|
|
watch( |
|
|
() =>props.apiPage, |
|
|
() => props.apiPage, |
|
|
() => { |
|
|
() => { |
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
getListApi: props.apiPage // 分页接口 |
|
|
getListApi: props.apiPage // 分页接口 |
|
@ -547,7 +555,7 @@ watch( |
|
|
tableMethodsRef.value = tableMethods |
|
|
tableMethodsRef.value = tableMethods |
|
|
const { getList } = tableMethods |
|
|
const { getList } = tableMethods |
|
|
getList() |
|
|
getList() |
|
|
}, |
|
|
} |
|
|
) |
|
|
) |
|
|
</script> |
|
|
</script> |
|
|
<style lang="scss"> |
|
|
<style lang="scss"> |
|
|