|
@ -2,9 +2,10 @@ |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<!-- 搜索工作栏 --> |
|
|
<!-- 搜索工作栏 --> |
|
|
<Search |
|
|
<Search |
|
|
:schema="InspectionJobMain.allSchemas.searchSchema" |
|
|
ref="searchRef" |
|
|
@search="setSearchParams" |
|
|
:schema="searchSchema" |
|
|
@reset="setSearchParams" |
|
|
@search="searchParams" |
|
|
|
|
|
@reset="searchParams" |
|
|
/> |
|
|
/> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
@ -124,8 +125,6 @@ import { getReportUrl } from '@/utils/systemParam' |
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
|
|
|
|
|
|
// 采购订单 |
|
|
|
|
|
defineOptions({ name: 'inspectionJobMain' }) |
|
|
|
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
const message = useMessage() // 消息弹窗 |
|
|
const { t } = useI18n() // 国际化 |
|
|
const { t } = useI18n() // 国际化 |
|
@ -181,7 +180,19 @@ const { tableObject, tableMethods } = useTable({ |
|
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
// 获得表格的各种操作 |
|
|
const { getList, setSearchParams } = tableMethods |
|
|
const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
const searchParams = (model) => { |
|
|
|
|
|
if (route.name == 'inspectionJobProduction') { |
|
|
|
|
|
model.available = 'TRUE' |
|
|
|
|
|
model.inspectionType = '4' |
|
|
|
|
|
} else if (route.name == 'inspectionJobPurchase') { |
|
|
|
|
|
model.available = 'TRUE' |
|
|
|
|
|
model.inspectionType = '1' |
|
|
|
|
|
} else { |
|
|
|
|
|
model.available = 'TRUE' |
|
|
|
|
|
model.excludeInspectionType = '1,4' |
|
|
|
|
|
} |
|
|
|
|
|
setSearchParams(model) |
|
|
|
|
|
} |
|
|
// 列表头部按钮 |
|
|
// 列表头部按钮 |
|
|
const HeadButttondata = [ |
|
|
const HeadButttondata = [ |
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'qms:inspection-job-main:export' }), // 导出 |
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'qms:inspection-job-main:export' }), // 导出 |
|
@ -453,13 +464,13 @@ const handleImport = () => { |
|
|
const searchFormClick = (searchData) => { |
|
|
const searchFormClick = (searchData) => { |
|
|
let isHave = searchData?.filters?.some((item) => item.column == 'inspectionType') |
|
|
let isHave = searchData?.filters?.some((item) => item.column == 'inspectionType') |
|
|
if (!isHave) { |
|
|
if (!isHave) { |
|
|
if (route.name == 'inspectionJobProductionMain') { |
|
|
if (route.name == 'inspectionJobProduction') { |
|
|
searchData.filters.push({ |
|
|
searchData.filters.push({ |
|
|
action: '==', |
|
|
action: '==', |
|
|
column: 'inspectionType', |
|
|
column: 'inspectionType', |
|
|
value: '4' |
|
|
value: '4' |
|
|
}) |
|
|
}) |
|
|
} else if (route.name == 'inspectionJobPurchaseMain') { |
|
|
} else if (route.name == 'inspectionJobPurchase') { |
|
|
searchData.filters.push({ |
|
|
searchData.filters.push({ |
|
|
action: '==', |
|
|
action: '==', |
|
|
column: 'inspectionType', |
|
|
column: 'inspectionType', |
|
@ -479,47 +490,48 @@ const searchFormClick = (searchData) => { |
|
|
} |
|
|
} |
|
|
getList() // 刷新当前列表 |
|
|
getList() // 刷新当前列表 |
|
|
} |
|
|
} |
|
|
|
|
|
const searchRef = ref() |
|
|
|
|
|
const searchSchema = ref(JSON.parse(JSON.stringify(InspectionJobMain.allSchemas.searchSchema))) |
|
|
|
|
|
const options = InspectionJobMain.allSchemas.searchSchema.find((item) => item.field == 'inspectionType') |
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
console.log(11,route.name) |
|
|
if (route.name == 'inspectionJobProduction') { |
|
|
if (route.name == 'inspectionJobProductionMain') { |
|
|
|
|
|
tableObject.params = { |
|
|
tableObject.params = { |
|
|
available: true, |
|
|
available: true, |
|
|
inspectionType: '4' |
|
|
inspectionType: '4' |
|
|
} |
|
|
} |
|
|
} else if (route.name == 'inspectionJobPurchaseMain') { |
|
|
searchSchema.value.forEach((item) => { |
|
|
|
|
|
if (item.field == 'inspectionType') { |
|
|
|
|
|
item.componentProps.options=options.componentProps.options?.filter((cur) => cur.value == '4') |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
console.log(999,searchSchema.value) |
|
|
|
|
|
searchRef.value.setFormValues({ inspectionType: '4' }) |
|
|
|
|
|
} else if (route.name == 'inspectionJobPurchase') { |
|
|
tableObject.params = { |
|
|
tableObject.params = { |
|
|
available: true, |
|
|
available: true, |
|
|
inspectionType: '1' |
|
|
inspectionType: '1' |
|
|
} |
|
|
} |
|
|
|
|
|
searchSchema.value.forEach((item) => { |
|
|
|
|
|
if (item.field == 'inspectionType') { |
|
|
|
|
|
item.componentProps.options = options.componentProps.options?.filter((cur) => cur.value == '1') |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
searchRef.value.setFormValues({ inspectionType: '1' }) |
|
|
} else { |
|
|
} else { |
|
|
tableObject.params = { |
|
|
tableObject.params = { |
|
|
available: true, |
|
|
available: true, |
|
|
excludeInspectionType: '1,4' |
|
|
excludeInspectionType: '1,4' |
|
|
} |
|
|
} |
|
|
|
|
|
searchSchema.value.forEach((item) => { |
|
|
|
|
|
if (item.field == 'inspectionType') { |
|
|
|
|
|
item.componentProps.options = options.componentProps.options?.filter(cur=>cur.value != '1' && cur.value != '4') |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
searchParams(tableObject.params) |
|
|
getList() |
|
|
|
|
|
// importTemplateData.templateUrl = await InspectionJobMainApi.importTemplate() |
|
|
|
|
|
}) |
|
|
}) |
|
|
onActivated(() => { |
|
|
defineExpose({ |
|
|
if (route.name == 'inspectionJobProductionMain') { |
|
|
getList |
|
|
tableObject.params = { |
|
|
|
|
|
available: true, |
|
|
|
|
|
inspectionType: '4' |
|
|
|
|
|
} |
|
|
|
|
|
} else if (route.name == 'inspectionJobPurchaseMain') { |
|
|
|
|
|
tableObject.params = { |
|
|
|
|
|
available: true, |
|
|
|
|
|
inspectionType: '1' |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
tableObject.params = { |
|
|
|
|
|
available: true, |
|
|
|
|
|
excludeInspectionType: '1,4' |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getList() |
|
|
|
|
|
}) |
|
|
}) |
|
|
</script> |
|
|
</script> |
|
|