diff --git a/src/views/qms/inspectionJob/index.vue b/src/views/qms/inspectionJob/index.vue index b8e167a86..a4d7aaa94 100644 --- a/src/views/qms/inspectionJob/index.vue +++ b/src/views/qms/inspectionJob/index.vue @@ -2,9 +2,10 @@ @@ -124,8 +125,6 @@ import { getReportUrl } from '@/utils/systemParam' import { useUserStore } from '@/store/modules/user' import { formatDate } from '@/utils/formatTime' -// 采购订单 -defineOptions({ name: 'inspectionJobMain' }) const message = useMessage() // 消息弹窗 const { t } = useI18n() // 国际化 @@ -181,7 +180,19 @@ const { tableObject, tableMethods } = useTable({ // 获得表格的各种操作 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 = [ defaultButtons.defaultExportBtn({ hasPermi: 'qms:inspection-job-main:export' }), // 导出 @@ -453,13 +464,13 @@ const handleImport = () => { const searchFormClick = (searchData) => { let isHave = searchData?.filters?.some((item) => item.column == 'inspectionType') if (!isHave) { - if (route.name == 'inspectionJobProductionMain') { + if (route.name == 'inspectionJobProduction') { searchData.filters.push({ action: '==', column: 'inspectionType', value: '4' }) - } else if (route.name == 'inspectionJobPurchaseMain') { + } else if (route.name == 'inspectionJobPurchase') { searchData.filters.push({ action: '==', column: 'inspectionType', @@ -479,47 +490,48 @@ const searchFormClick = (searchData) => { } 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 () => { - console.log(11,route.name) - if (route.name == 'inspectionJobProductionMain') { + if (route.name == 'inspectionJobProduction') { tableObject.params = { available: true, 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 = { available: true, 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 { tableObject.params = { available: true, 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') + } + }) } - - getList() - // importTemplateData.templateUrl = await InspectionJobMainApi.importTemplate() + searchParams(tableObject.params) }) -onActivated(() => { - if (route.name == 'inspectionJobProductionMain') { - 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() +defineExpose({ + getList }) diff --git a/src/views/qms/inspectionJob/inspectionJob.vue b/src/views/qms/inspectionJob/inspectionJob.vue new file mode 100644 index 000000000..d56f366d8 --- /dev/null +++ b/src/views/qms/inspectionJob/inspectionJob.vue @@ -0,0 +1,14 @@ + + + diff --git a/src/views/qms/inspectionJob/inspectionJobMain.data.ts b/src/views/qms/inspectionJob/inspectionJobMain.data.ts index 0a89714df..30a62efa2 100644 --- a/src/views/qms/inspectionJob/inspectionJobMain.data.ts +++ b/src/views/qms/inspectionJob/inspectionJobMain.data.ts @@ -272,7 +272,7 @@ export const InspectionJobMain = useCrudSchemas( label: '检验类型', field: 'inspectionType', sort: 'custom', - dictType: DICT_TYPE.INSPECTION_TYPE_NEW, + dictType: DICT_TYPE.INSPECTION_TYPE, dictClass: 'string', isSearch: true, form: { @@ -293,7 +293,7 @@ export const InspectionJobMain = useCrudSchemas( dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isTable: false, isDetail: false, - isSearch: true, + isSearch: false, isTableForm: false, isForm: false }, diff --git a/src/views/qms/inspectionJob/inspectionJobProduction.vue b/src/views/qms/inspectionJob/inspectionJobProduction.vue new file mode 100644 index 000000000..0bbb67e6a --- /dev/null +++ b/src/views/qms/inspectionJob/inspectionJobProduction.vue @@ -0,0 +1,14 @@ + + + diff --git a/src/views/qms/inspectionJob/inspectionJobPurchase.vue b/src/views/qms/inspectionJob/inspectionJobPurchase.vue new file mode 100644 index 000000000..009806780 --- /dev/null +++ b/src/views/qms/inspectionJob/inspectionJobPurchase.vue @@ -0,0 +1,15 @@ + + + diff --git a/src/views/qms/inspectionRecord/index.vue b/src/views/qms/inspectionRecord/index.vue index 2af87c949..636e3e2de 100644 --- a/src/views/qms/inspectionRecord/index.vue +++ b/src/views/qms/inspectionRecord/index.vue @@ -3,8 +3,8 @@ @@ -172,6 +172,19 @@ const { tableObject, tableMethods } = useTable({ // 获得表格的各种操作 const { getList, setSearchParams } = tableMethods +const searchParams = (model) => { + if (route.name == 'inspectionRecordProduction') { + model.available = 'TRUE' + model.inspectionType = '4' + } else if (route.name == 'inspectionRecordPurchase') { + model.available = 'TRUE' + model.inspectionType = '1' + } else { + model.available = 'TRUE' + model.excludeInspectionType = '1,4,11' + } + setSearchParams(model) +} // 列表头部按钮 let HeadButttondata = [ defaultButtons.defaultExportBtn({ hasPermi: 'qms:inspection-recode-main:export' }), // 导出 @@ -431,7 +444,7 @@ const submitFormExecute = async (formType, data) => { const searchFormClick = (searchData) => { let isHave = searchData?.filters?.some((item) => item.column == 'inspectionType') if (!isHave) { - if (route.name == 'inspectionRecordPurchaseMain') { + if (route.name == 'inspectionRecordPurchase') { searchData.filters.push({ action: '==', column: 'inspectionType', @@ -441,7 +454,7 @@ const searchFormClick = (searchData) => { column: 'available', value: true }) - } else if (route.name == 'inspectionRecordProductionMain') { + } else if (route.name == 'inspectionRecordProduction') { searchData.filters.push({ action: '==', column: 'inspectionType', @@ -469,12 +482,12 @@ const searchFormClick = (searchData) => { /** 初始化 **/ onMounted(async () => { - if (route.name == 'inspectionRecordPurchaseMain') { + if (route.name == 'inspectionRecordPurchase') { tableObject.params = { available: true, inspectionType: '1' } - } else if (route.name == 'inspectionRecordProductionMain') { + } else if (route.name == 'inspectionRecordProduction') { tableObject.params = { available: true, inspectionType: '4' @@ -488,24 +501,7 @@ onMounted(async () => { getList() }) -onActivated(() => { - if (route.name == 'inspectionRecordPurchaseMain') { - tableObject.params = { - available: true, - inspectionType: '1' - } - } else if (route.name == 'inspectionRecordProductionMain') { - tableObject.params = { - available: true, - inspectionType: '4' - } - } else { - tableObject.params = { - available: true, - excludeInspectionType: '1,4,11' - } - } - - getList() +defineExpose({ + getList }) diff --git a/src/views/qms/inspectionRecord/inspectionRecord.vue b/src/views/qms/inspectionRecord/inspectionRecord.vue new file mode 100644 index 000000000..59c7d2520 --- /dev/null +++ b/src/views/qms/inspectionRecord/inspectionRecord.vue @@ -0,0 +1,14 @@ + + + diff --git a/src/views/qms/inspectionRecord/inspectionRecordProduction.vue b/src/views/qms/inspectionRecord/inspectionRecordProduction.vue new file mode 100644 index 000000000..1e353a101 --- /dev/null +++ b/src/views/qms/inspectionRecord/inspectionRecordProduction.vue @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/src/views/qms/inspectionRecord/inspectionRecordPurchase.vue b/src/views/qms/inspectionRecord/inspectionRecordPurchase.vue new file mode 100644 index 000000000..8f4d0a7b6 --- /dev/null +++ b/src/views/qms/inspectionRecord/inspectionRecordPurchase.vue @@ -0,0 +1,14 @@ + + + \ No newline at end of file