Browse Source

计数器修改下一阶段

hella_online_20240829
zhaoyiran 4 months ago
parent
commit
1a32a447f8
  1. 4
      src/api/qms/counter/index.ts
  2. 37
      src/views/qms/counter/counter.data.ts
  3. 10
      src/views/qms/counter/index.vue

4
src/api/qms/counter/index.ts

@ -60,3 +60,7 @@ export const exportCounter = async (params) => {
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/qms/counter/get-import-template' }) 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})
}

37
src/views/qms/counter/counter.data.ts

@ -21,6 +21,7 @@ export const Counter = useCrudSchemas(
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
fixed: 'left', fixed: 'left',
isForm: false,
table: { table: {
fixed: 'left', fixed: 'left',
width: 175 width: 175
@ -32,6 +33,7 @@ export const Counter = useCrudSchemas(
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
dictType: DICT_TYPE.INSPECTION_TYPE, dictType: DICT_TYPE.INSPECTION_TYPE,
isForm: false,
table: { table: {
width: 175 width: 175
} }
@ -41,6 +43,7 @@ export const Counter = useCrudSchemas(
field: 'supplierCode', field: 'supplierCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm: false,
table: { table: {
width: 175 width: 175
} }
@ -50,6 +53,7 @@ export const Counter = useCrudSchemas(
field: 'qualifiedTimes', field: 'qualifiedTimes',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm: false,
table: { table: {
width: 140 width: 140
} }
@ -59,6 +63,7 @@ export const Counter = useCrudSchemas(
field: 'lastQualifiedBatch', field: 'lastQualifiedBatch',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm: false,
table: { table: {
width: 140 width: 140
} }
@ -69,6 +74,7 @@ export const Counter = useCrudSchemas(
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, isSearch: true,
isForm: false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -93,6 +99,7 @@ export const Counter = useCrudSchemas(
field: 'unqualifiedTimes', field: 'unqualifiedTimes',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm: false,
form: { form: {
component: 'InputNumber', component: 'InputNumber',
value: 0 value: 0
@ -106,6 +113,7 @@ export const Counter = useCrudSchemas(
field: 'lastUnqualifiedBatch', field: 'lastUnqualifiedBatch',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm: false,
form: { form: {
component: 'InputNumber', component: 'InputNumber',
value: 0 value: 0
@ -120,6 +128,7 @@ export const Counter = useCrudSchemas(
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: false, isSearch: false,
isForm: false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -144,6 +153,16 @@ export const Counter = useCrudSchemas(
field: 'nextStage', field: 'nextStage',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
form:{
component: 'Select',
componentProps: {
options:[],
optionsAlias: {
labelField: 'stage',
valueField: 'stage'
}
}
},
table: { table: {
width: 140 width: 140
} }
@ -213,14 +232,14 @@ export const Counter = useCrudSchemas(
} }
}, },
// { {
// label: '操作', label: '操作',
// field: 'action', field: 'action',
// isForm: false, isForm: false,
// table: { table: {
// width: 150, width: 150,
// fixed: 'right' fixed: 'right'
// } }
// } }
]) ])
) )

10
src/views/qms/counter/index.vue

@ -134,7 +134,7 @@ const buttonBaseClick = (val, item) => {
// - // -
const butttondata = [ const butttondata = [
// defaultButtons.mainListEditBtn({hasPermi:'qms:counter:update'}), // defaultButtons.mainListEditBtn({hasPermi:'qms:counter:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'qms:counter:delete'}), // // defaultButtons.mainListDeleteBtn({hasPermi:'qms:counter:delete'}), //
] ]
@ -149,7 +149,13 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() 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) basicFormRef.value.open(type, row)
} }

Loading…
Cancel
Save