diff --git a/src/api/qms/counter/index.ts b/src/api/qms/counter/index.ts index cd6d8e2a9..9ae69ff10 100644 --- a/src/api/qms/counter/index.ts +++ b/src/api/qms/counter/index.ts @@ -60,3 +60,7 @@ export const exportCounter = async (params) => { export const importTemplate = () => { return request.download({ url: '/qms/counter/get-import-template' }) } + +export const getNextStage = async (id:number) => { + return await request.get({ url: `/qms/counter/getNextStage?id=` + id}) +} diff --git a/src/views/qms/counter/counter.data.ts b/src/views/qms/counter/counter.data.ts index 96a3cb3ea..9723b65a8 100644 --- a/src/views/qms/counter/counter.data.ts +++ b/src/views/qms/counter/counter.data.ts @@ -21,6 +21,7 @@ export const Counter = useCrudSchemas( sort: 'custom', isSearch: true, fixed: 'left', + isForm: false, table: { fixed: 'left', width: 175 @@ -32,6 +33,7 @@ export const Counter = useCrudSchemas( sort: 'custom', isSearch: true, dictType: DICT_TYPE.INSPECTION_TYPE, + isForm: false, table: { width: 175 } @@ -41,6 +43,7 @@ export const Counter = useCrudSchemas( field: 'supplierCode', sort: 'custom', isSearch: true, + isForm: false, table: { width: 175 } @@ -50,6 +53,7 @@ export const Counter = useCrudSchemas( field: 'qualifiedTimes', sort: 'custom', isSearch: false, + isForm: false, table: { width: 140 } @@ -59,6 +63,7 @@ export const Counter = useCrudSchemas( field: 'lastQualifiedBatch', sort: 'custom', isSearch: false, + isForm: false, table: { width: 140 } @@ -69,6 +74,7 @@ export const Counter = useCrudSchemas( sort: 'custom', formatter: dateFormatter, isSearch: true, + isForm: false, search: { component: 'DatePicker', componentProps: { @@ -93,6 +99,7 @@ export const Counter = useCrudSchemas( field: 'unqualifiedTimes', sort: 'custom', isSearch: false, + isForm: false, form: { component: 'InputNumber', value: 0 @@ -106,6 +113,7 @@ export const Counter = useCrudSchemas( field: 'lastUnqualifiedBatch', sort: 'custom', isSearch: false, + isForm: false, form: { component: 'InputNumber', value: 0 @@ -120,6 +128,7 @@ export const Counter = useCrudSchemas( sort: 'custom', formatter: dateFormatter, isSearch: false, + isForm: false, search: { component: 'DatePicker', componentProps: { @@ -144,6 +153,16 @@ export const Counter = useCrudSchemas( field: 'nextStage', sort: 'custom', isSearch: false, + form:{ + component: 'Select', + componentProps: { + options:[], + optionsAlias: { + labelField: 'stage', + valueField: 'stage' + } + } + }, table: { width: 140 } @@ -213,14 +232,14 @@ export const Counter = useCrudSchemas( } }, - // { - // label: '操作', - // field: 'action', - // isForm: false, - // table: { - // width: 150, - // fixed: 'right' - // } - // } + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } ]) ) diff --git a/src/views/qms/counter/index.vue b/src/views/qms/counter/index.vue index d58b262cf..943033c8e 100644 --- a/src/views/qms/counter/index.vue +++ b/src/views/qms/counter/index.vue @@ -134,7 +134,7 @@ const buttonBaseClick = (val, item) => { // 列表-操作按钮 const butttondata = [ - // defaultButtons.mainListEditBtn({hasPermi:'qms:counter:update'}), // 编辑 + defaultButtons.mainListEditBtn({hasPermi:'qms:counter:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hasPermi:'qms:counter:delete'}), // 删除 ] @@ -149,7 +149,13 @@ const buttonTableClick = async (val, row) => { /** 添加/修改操作 */ const basicFormRef = ref() -const openForm = (type: string, row?: any) => { + +const openForm = async (type: string, row?: any) => { + for (const item of Counter.allSchemas.formSchema) { + if (item.field === 'nextStage') { + item.componentProps.options = await CounterApi.getNextStage(row.id) + } + } basicFormRef.value.open(type, row) }