diff --git a/src/api/system/process.ts b/src/api/system/process.ts index f1f5e7b..e459424 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -49,7 +49,7 @@ } // 流程定义编辑 -export function efitProcess(params: Object) { +export function editProcess(params: Object) { const param = { _value: params, } @@ -60,6 +60,18 @@ }) } +// 新建流程 +export function addProcess(params: Object) { + const param = { + _value: params, + } + return request({ + url: `${prefix}/jsonToBpmn`, + method: 'post', + data: param, + }) +} + // 获取流程定义详情 export function getProcessDetail(formId: string) { const param = { @@ -100,7 +112,7 @@ beginTime: string endTime: string status: string - ids: string[] + // ids: string[] }) { return request({ url: `${prefix}/listExport`, diff --git a/src/api/system/process.ts b/src/api/system/process.ts index f1f5e7b..e459424 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -49,7 +49,7 @@ } // 流程定义编辑 -export function efitProcess(params: Object) { +export function editProcess(params: Object) { const param = { _value: params, } @@ -60,6 +60,18 @@ }) } +// 新建流程 +export function addProcess(params: Object) { + const param = { + _value: params, + } + return request({ + url: `${prefix}/jsonToBpmn`, + method: 'post', + data: param, + }) +} + // 获取流程定义详情 export function getProcessDetail(formId: string) { const param = { @@ -100,7 +112,7 @@ beginTime: string endTime: string status: string - ids: string[] + // ids: string[] }) { return request({ url: `${prefix}/listExport`, diff --git a/src/components/dialog/selectEmployeesDialog.vue b/src/components/dialog/selectEmployeesDialog.vue index dc67b48..6db84db 100644 --- a/src/components/dialog/selectEmployeesDialog.vue +++ b/src/components/dialog/selectEmployeesDialog.vue @@ -76,7 +76,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map(item => ({ ...item, - type: 2, // type是啥 + type: 1, // type: 1.成员 2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/api/system/process.ts b/src/api/system/process.ts index f1f5e7b..e459424 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -49,7 +49,7 @@ } // 流程定义编辑 -export function efitProcess(params: Object) { +export function editProcess(params: Object) { const param = { _value: params, } @@ -60,6 +60,18 @@ }) } +// 新建流程 +export function addProcess(params: Object) { + const param = { + _value: params, + } + return request({ + url: `${prefix}/jsonToBpmn`, + method: 'post', + data: param, + }) +} + // 获取流程定义详情 export function getProcessDetail(formId: string) { const param = { @@ -100,7 +112,7 @@ beginTime: string endTime: string status: string - ids: string[] + // ids: string[] }) { return request({ url: `${prefix}/listExport`, diff --git a/src/components/dialog/selectEmployeesDialog.vue b/src/components/dialog/selectEmployeesDialog.vue index dc67b48..6db84db 100644 --- a/src/components/dialog/selectEmployeesDialog.vue +++ b/src/components/dialog/selectEmployeesDialog.vue @@ -76,7 +76,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map(item => ({ ...item, - type: 2, // type是啥 + type: 1, // type: 1.成员 2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/dialog/selectRoleDialog.vue b/src/components/dialog/selectRoleDialog.vue index 38881f4..64f51ae 100644 --- a/src/components/dialog/selectRoleDialog.vue +++ b/src/components/dialog/selectRoleDialog.vue @@ -71,7 +71,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map((item: any) => ({ ...item, - type: 2, // type是啥 + type: 2, // type:1.成员,2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/api/system/process.ts b/src/api/system/process.ts index f1f5e7b..e459424 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -49,7 +49,7 @@ } // 流程定义编辑 -export function efitProcess(params: Object) { +export function editProcess(params: Object) { const param = { _value: params, } @@ -60,6 +60,18 @@ }) } +// 新建流程 +export function addProcess(params: Object) { + const param = { + _value: params, + } + return request({ + url: `${prefix}/jsonToBpmn`, + method: 'post', + data: param, + }) +} + // 获取流程定义详情 export function getProcessDetail(formId: string) { const param = { @@ -100,7 +112,7 @@ beginTime: string endTime: string status: string - ids: string[] + // ids: string[] }) { return request({ url: `${prefix}/listExport`, diff --git a/src/components/dialog/selectEmployeesDialog.vue b/src/components/dialog/selectEmployeesDialog.vue index dc67b48..6db84db 100644 --- a/src/components/dialog/selectEmployeesDialog.vue +++ b/src/components/dialog/selectEmployeesDialog.vue @@ -76,7 +76,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map(item => ({ ...item, - type: 2, // type是啥 + type: 1, // type: 1.成员 2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/dialog/selectRoleDialog.vue b/src/components/dialog/selectRoleDialog.vue index 38881f4..64f51ae 100644 --- a/src/components/dialog/selectRoleDialog.vue +++ b/src/components/dialog/selectRoleDialog.vue @@ -71,7 +71,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map((item: any) => ({ ...item, - type: 2, // type是啥 + type: 2, // type:1.成员,2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/drawer/approverDrawer.vue b/src/components/drawer/approverDrawer.vue index 0f8a37d..7f5cd2f 100644 --- a/src/components/drawer/approverDrawer.vue +++ b/src/components/drawer/approverDrawer.vue @@ -148,9 +148,6 @@ return } - // if (approverConfig.value.settype === 11) { - // approverConfig.value.settype = 1 - // } // 把审批设置反应在流程图里面 approverConfig.value.error = !$func.setApproverStr(approverConfig.value) // 保存设置 diff --git a/src/api/system/process.ts b/src/api/system/process.ts index f1f5e7b..e459424 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -49,7 +49,7 @@ } // 流程定义编辑 -export function efitProcess(params: Object) { +export function editProcess(params: Object) { const param = { _value: params, } @@ -60,6 +60,18 @@ }) } +// 新建流程 +export function addProcess(params: Object) { + const param = { + _value: params, + } + return request({ + url: `${prefix}/jsonToBpmn`, + method: 'post', + data: param, + }) +} + // 获取流程定义详情 export function getProcessDetail(formId: string) { const param = { @@ -100,7 +112,7 @@ beginTime: string endTime: string status: string - ids: string[] + // ids: string[] }) { return request({ url: `${prefix}/listExport`, diff --git a/src/components/dialog/selectEmployeesDialog.vue b/src/components/dialog/selectEmployeesDialog.vue index dc67b48..6db84db 100644 --- a/src/components/dialog/selectEmployeesDialog.vue +++ b/src/components/dialog/selectEmployeesDialog.vue @@ -76,7 +76,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map(item => ({ ...item, - type: 2, // type是啥 + type: 1, // type: 1.成员 2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/dialog/selectRoleDialog.vue b/src/components/dialog/selectRoleDialog.vue index 38881f4..64f51ae 100644 --- a/src/components/dialog/selectRoleDialog.vue +++ b/src/components/dialog/selectRoleDialog.vue @@ -71,7 +71,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map((item: any) => ({ ...item, - type: 2, // type是啥 + type: 2, // type:1.成员,2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/drawer/approverDrawer.vue b/src/components/drawer/approverDrawer.vue index 0f8a37d..7f5cd2f 100644 --- a/src/components/drawer/approverDrawer.vue +++ b/src/components/drawer/approverDrawer.vue @@ -148,9 +148,6 @@ return } - // if (approverConfig.value.settype === 11) { - // approverConfig.value.settype = 1 - // } // 把审批设置反应在流程图里面 approverConfig.value.error = !$func.setApproverStr(approverConfig.value) // 保存设置 diff --git a/src/components/workFlow/nodeWrap.vue b/src/components/workFlow/nodeWrap.vue index a97f752..90bc3ad 100644 --- a/src/components/workFlow/nodeWrap.vue +++ b/src/components/workFlow/nodeWrap.vue @@ -28,14 +28,15 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { - return userStore.name - // return $func.arrToStr(props.flowPermission) || '所有人' + if (props.nodeConfig.type == 0) { // 发起人 + // return userStore.name + // return $func.arrToStr(props.flowPermission) || userStore.name + return props.flowPermission.name || userStore.name } - if (props.nodeConfig.type == 1) { + if (props.nodeConfig.type == 1) { // 审批 return $func.setApproverStr(props.nodeConfig) } - return $func.copyerStr(props.nodeConfig) + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/api/system/process.ts b/src/api/system/process.ts index f1f5e7b..e459424 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -49,7 +49,7 @@ } // 流程定义编辑 -export function efitProcess(params: Object) { +export function editProcess(params: Object) { const param = { _value: params, } @@ -60,6 +60,18 @@ }) } +// 新建流程 +export function addProcess(params: Object) { + const param = { + _value: params, + } + return request({ + url: `${prefix}/jsonToBpmn`, + method: 'post', + data: param, + }) +} + // 获取流程定义详情 export function getProcessDetail(formId: string) { const param = { @@ -100,7 +112,7 @@ beginTime: string endTime: string status: string - ids: string[] + // ids: string[] }) { return request({ url: `${prefix}/listExport`, diff --git a/src/components/dialog/selectEmployeesDialog.vue b/src/components/dialog/selectEmployeesDialog.vue index dc67b48..6db84db 100644 --- a/src/components/dialog/selectEmployeesDialog.vue +++ b/src/components/dialog/selectEmployeesDialog.vue @@ -76,7 +76,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map(item => ({ ...item, - type: 2, // type是啥 + type: 1, // type: 1.成员 2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/dialog/selectRoleDialog.vue b/src/components/dialog/selectRoleDialog.vue index 38881f4..64f51ae 100644 --- a/src/components/dialog/selectRoleDialog.vue +++ b/src/components/dialog/selectRoleDialog.vue @@ -71,7 +71,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map((item: any) => ({ ...item, - type: 2, // type是啥 + type: 2, // type:1.成员,2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/drawer/approverDrawer.vue b/src/components/drawer/approverDrawer.vue index 0f8a37d..7f5cd2f 100644 --- a/src/components/drawer/approverDrawer.vue +++ b/src/components/drawer/approverDrawer.vue @@ -148,9 +148,6 @@ return } - // if (approverConfig.value.settype === 11) { - // approverConfig.value.settype = 1 - // } // 把审批设置反应在流程图里面 approverConfig.value.error = !$func.setApproverStr(approverConfig.value) // 保存设置 diff --git a/src/components/workFlow/nodeWrap.vue b/src/components/workFlow/nodeWrap.vue index a97f752..90bc3ad 100644 --- a/src/components/workFlow/nodeWrap.vue +++ b/src/components/workFlow/nodeWrap.vue @@ -28,14 +28,15 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { - return userStore.name - // return $func.arrToStr(props.flowPermission) || '所有人' + if (props.nodeConfig.type == 0) { // 发起人 + // return userStore.name + // return $func.arrToStr(props.flowPermission) || userStore.name + return props.flowPermission.name || userStore.name } - if (props.nodeConfig.type == 1) { + if (props.nodeConfig.type == 1) { // 审批 return $func.setApproverStr(props.nodeConfig) } - return $func.copyerStr(props.nodeConfig) + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/components/workFlow/nodeWrapBan.vue b/src/components/workFlow/nodeWrapBan.vue index 2de6650..457d9ab 100644 --- a/src/components/workFlow/nodeWrapBan.vue +++ b/src/components/workFlow/nodeWrapBan.vue @@ -25,11 +25,16 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { return $func.arrToStr(props.flowPermission) || '所有人' } - if (props.nodeConfig.type == 1) { - return $func.setApproverStr(props.nodeConfig) + if (props.nodeConfig.type == 0) { + console.log('pppppppp') + console.log(props.flowPermission) + // return $func.arrToStr(props.flowPermission) || '所有人' + return props.flowPermission.name || userStore.name } - return $func.copyerStr(props.nodeConfig) + if (props.nodeConfig.type == 1) { + return $func.setApproverStr(props.nodeConfig) // 审批 + } + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/api/system/process.ts b/src/api/system/process.ts index f1f5e7b..e459424 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -49,7 +49,7 @@ } // 流程定义编辑 -export function efitProcess(params: Object) { +export function editProcess(params: Object) { const param = { _value: params, } @@ -60,6 +60,18 @@ }) } +// 新建流程 +export function addProcess(params: Object) { + const param = { + _value: params, + } + return request({ + url: `${prefix}/jsonToBpmn`, + method: 'post', + data: param, + }) +} + // 获取流程定义详情 export function getProcessDetail(formId: string) { const param = { @@ -100,7 +112,7 @@ beginTime: string endTime: string status: string - ids: string[] + // ids: string[] }) { return request({ url: `${prefix}/listExport`, diff --git a/src/components/dialog/selectEmployeesDialog.vue b/src/components/dialog/selectEmployeesDialog.vue index dc67b48..6db84db 100644 --- a/src/components/dialog/selectEmployeesDialog.vue +++ b/src/components/dialog/selectEmployeesDialog.vue @@ -76,7 +76,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map(item => ({ ...item, - type: 2, // type是啥 + type: 1, // type: 1.成员 2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/dialog/selectRoleDialog.vue b/src/components/dialog/selectRoleDialog.vue index 38881f4..64f51ae 100644 --- a/src/components/dialog/selectRoleDialog.vue +++ b/src/components/dialog/selectRoleDialog.vue @@ -71,7 +71,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map((item: any) => ({ ...item, - type: 2, // type是啥 + type: 2, // type:1.成员,2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/drawer/approverDrawer.vue b/src/components/drawer/approverDrawer.vue index 0f8a37d..7f5cd2f 100644 --- a/src/components/drawer/approverDrawer.vue +++ b/src/components/drawer/approverDrawer.vue @@ -148,9 +148,6 @@ return } - // if (approverConfig.value.settype === 11) { - // approverConfig.value.settype = 1 - // } // 把审批设置反应在流程图里面 approverConfig.value.error = !$func.setApproverStr(approverConfig.value) // 保存设置 diff --git a/src/components/workFlow/nodeWrap.vue b/src/components/workFlow/nodeWrap.vue index a97f752..90bc3ad 100644 --- a/src/components/workFlow/nodeWrap.vue +++ b/src/components/workFlow/nodeWrap.vue @@ -28,14 +28,15 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { - return userStore.name - // return $func.arrToStr(props.flowPermission) || '所有人' + if (props.nodeConfig.type == 0) { // 发起人 + // return userStore.name + // return $func.arrToStr(props.flowPermission) || userStore.name + return props.flowPermission.name || userStore.name } - if (props.nodeConfig.type == 1) { + if (props.nodeConfig.type == 1) { // 审批 return $func.setApproverStr(props.nodeConfig) } - return $func.copyerStr(props.nodeConfig) + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/components/workFlow/nodeWrapBan.vue b/src/components/workFlow/nodeWrapBan.vue index 2de6650..457d9ab 100644 --- a/src/components/workFlow/nodeWrapBan.vue +++ b/src/components/workFlow/nodeWrapBan.vue @@ -25,11 +25,16 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { return $func.arrToStr(props.flowPermission) || '所有人' } - if (props.nodeConfig.type == 1) { - return $func.setApproverStr(props.nodeConfig) + if (props.nodeConfig.type == 0) { + console.log('pppppppp') + console.log(props.flowPermission) + // return $func.arrToStr(props.flowPermission) || '所有人' + return props.flowPermission.name || userStore.name } - return $func.copyerStr(props.nodeConfig) + if (props.nodeConfig.type == 1) { + return $func.setApproverStr(props.nodeConfig) // 审批 + } + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index edac0e5..6f516aa 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -202,6 +202,18 @@ activeMenu: '/process/list', }, }, + { + path: 'add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, ], }, { diff --git a/src/api/system/process.ts b/src/api/system/process.ts index f1f5e7b..e459424 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -49,7 +49,7 @@ } // 流程定义编辑 -export function efitProcess(params: Object) { +export function editProcess(params: Object) { const param = { _value: params, } @@ -60,6 +60,18 @@ }) } +// 新建流程 +export function addProcess(params: Object) { + const param = { + _value: params, + } + return request({ + url: `${prefix}/jsonToBpmn`, + method: 'post', + data: param, + }) +} + // 获取流程定义详情 export function getProcessDetail(formId: string) { const param = { @@ -100,7 +112,7 @@ beginTime: string endTime: string status: string - ids: string[] + // ids: string[] }) { return request({ url: `${prefix}/listExport`, diff --git a/src/components/dialog/selectEmployeesDialog.vue b/src/components/dialog/selectEmployeesDialog.vue index dc67b48..6db84db 100644 --- a/src/components/dialog/selectEmployeesDialog.vue +++ b/src/components/dialog/selectEmployeesDialog.vue @@ -76,7 +76,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map(item => ({ ...item, - type: 2, // type是啥 + type: 1, // type: 1.成员 2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/dialog/selectRoleDialog.vue b/src/components/dialog/selectRoleDialog.vue index 38881f4..64f51ae 100644 --- a/src/components/dialog/selectRoleDialog.vue +++ b/src/components/dialog/selectRoleDialog.vue @@ -71,7 +71,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map((item: any) => ({ ...item, - type: 2, // type是啥 + type: 2, // type:1.成员,2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/drawer/approverDrawer.vue b/src/components/drawer/approverDrawer.vue index 0f8a37d..7f5cd2f 100644 --- a/src/components/drawer/approverDrawer.vue +++ b/src/components/drawer/approverDrawer.vue @@ -148,9 +148,6 @@ return } - // if (approverConfig.value.settype === 11) { - // approverConfig.value.settype = 1 - // } // 把审批设置反应在流程图里面 approverConfig.value.error = !$func.setApproverStr(approverConfig.value) // 保存设置 diff --git a/src/components/workFlow/nodeWrap.vue b/src/components/workFlow/nodeWrap.vue index a97f752..90bc3ad 100644 --- a/src/components/workFlow/nodeWrap.vue +++ b/src/components/workFlow/nodeWrap.vue @@ -28,14 +28,15 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { - return userStore.name - // return $func.arrToStr(props.flowPermission) || '所有人' + if (props.nodeConfig.type == 0) { // 发起人 + // return userStore.name + // return $func.arrToStr(props.flowPermission) || userStore.name + return props.flowPermission.name || userStore.name } - if (props.nodeConfig.type == 1) { + if (props.nodeConfig.type == 1) { // 审批 return $func.setApproverStr(props.nodeConfig) } - return $func.copyerStr(props.nodeConfig) + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/components/workFlow/nodeWrapBan.vue b/src/components/workFlow/nodeWrapBan.vue index 2de6650..457d9ab 100644 --- a/src/components/workFlow/nodeWrapBan.vue +++ b/src/components/workFlow/nodeWrapBan.vue @@ -25,11 +25,16 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { return $func.arrToStr(props.flowPermission) || '所有人' } - if (props.nodeConfig.type == 1) { - return $func.setApproverStr(props.nodeConfig) + if (props.nodeConfig.type == 0) { + console.log('pppppppp') + console.log(props.flowPermission) + // return $func.arrToStr(props.flowPermission) || '所有人' + return props.flowPermission.name || userStore.name } - return $func.copyerStr(props.nodeConfig) + if (props.nodeConfig.type == 1) { + return $func.setApproverStr(props.nodeConfig) // 审批 + } + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index edac0e5..6f516aa 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -202,6 +202,18 @@ activeMenu: '/process/list', }, }, + { + path: 'add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, ], }, { diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index e133fdb..5758df9 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -89,11 +89,20 @@ label: '逾期未检定', value: 'yqwjd', }, -] +]// 检定结果 +const mesureResultMap = { + hg: '合格', + xhhg: '修后合格', + xy: '限用', + zy: '准用', + bhg: '不合格', + lj: '漏检', + yqwjd: '逾期未检定', +}// 检定结果字典 const mesureTypeList = [ { - label: '外检', - value: 'wj', + label: '自检', + value: 'zj', }, { label: '外包', @@ -337,30 +346,32 @@ const getInfo = () => { getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'wj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // } + // res.data = { + // ABC: 'A', + // companyAddress: '北京/北京市', + // customerName: '京东集团', + // customerNo: 'sygf202211290001', + // id: '', + // labelBind: '11222', + // manufacturer: '北京某厂家', + // manufacturerCountry: 'CN', + // manufacturingDate: '2023-03', + // manufacturingNo: '123121', + // mesureCategory: 'jd', + // mesureContent: '项目1', + // mesurePeriod: '1', + // mesureType: 'zj', + // minioFileName: '小程序工期表-1117_1674961769128.xlsx', + // phone: '950618', + // postalCode: 'test', + // remark: '无备注', + // sampleModel: '型号1', + // sampleName: '样品1', + // sampleNo: '', + // measureResultCode: 'bhg', + // } dataForm.value = res.data + dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] for (const item of menu) { item.searchFunc() } @@ -599,7 +610,13 @@ - + - + - + diff --git a/src/api/system/process.ts b/src/api/system/process.ts index f1f5e7b..e459424 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -49,7 +49,7 @@ } // 流程定义编辑 -export function efitProcess(params: Object) { +export function editProcess(params: Object) { const param = { _value: params, } @@ -60,6 +60,18 @@ }) } +// 新建流程 +export function addProcess(params: Object) { + const param = { + _value: params, + } + return request({ + url: `${prefix}/jsonToBpmn`, + method: 'post', + data: param, + }) +} + // 获取流程定义详情 export function getProcessDetail(formId: string) { const param = { @@ -100,7 +112,7 @@ beginTime: string endTime: string status: string - ids: string[] + // ids: string[] }) { return request({ url: `${prefix}/listExport`, diff --git a/src/components/dialog/selectEmployeesDialog.vue b/src/components/dialog/selectEmployeesDialog.vue index dc67b48..6db84db 100644 --- a/src/components/dialog/selectEmployeesDialog.vue +++ b/src/components/dialog/selectEmployeesDialog.vue @@ -76,7 +76,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map(item => ({ ...item, - type: 2, // type是啥 + type: 1, // type: 1.成员 2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/dialog/selectRoleDialog.vue b/src/components/dialog/selectRoleDialog.vue index 38881f4..64f51ae 100644 --- a/src/components/dialog/selectRoleDialog.vue +++ b/src/components/dialog/selectRoleDialog.vue @@ -71,7 +71,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map((item: any) => ({ ...item, - type: 2, // type是啥 + type: 2, // type:1.成员,2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/drawer/approverDrawer.vue b/src/components/drawer/approverDrawer.vue index 0f8a37d..7f5cd2f 100644 --- a/src/components/drawer/approverDrawer.vue +++ b/src/components/drawer/approverDrawer.vue @@ -148,9 +148,6 @@ return } - // if (approverConfig.value.settype === 11) { - // approverConfig.value.settype = 1 - // } // 把审批设置反应在流程图里面 approverConfig.value.error = !$func.setApproverStr(approverConfig.value) // 保存设置 diff --git a/src/components/workFlow/nodeWrap.vue b/src/components/workFlow/nodeWrap.vue index a97f752..90bc3ad 100644 --- a/src/components/workFlow/nodeWrap.vue +++ b/src/components/workFlow/nodeWrap.vue @@ -28,14 +28,15 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { - return userStore.name - // return $func.arrToStr(props.flowPermission) || '所有人' + if (props.nodeConfig.type == 0) { // 发起人 + // return userStore.name + // return $func.arrToStr(props.flowPermission) || userStore.name + return props.flowPermission.name || userStore.name } - if (props.nodeConfig.type == 1) { + if (props.nodeConfig.type == 1) { // 审批 return $func.setApproverStr(props.nodeConfig) } - return $func.copyerStr(props.nodeConfig) + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/components/workFlow/nodeWrapBan.vue b/src/components/workFlow/nodeWrapBan.vue index 2de6650..457d9ab 100644 --- a/src/components/workFlow/nodeWrapBan.vue +++ b/src/components/workFlow/nodeWrapBan.vue @@ -25,11 +25,16 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { return $func.arrToStr(props.flowPermission) || '所有人' } - if (props.nodeConfig.type == 1) { - return $func.setApproverStr(props.nodeConfig) + if (props.nodeConfig.type == 0) { + console.log('pppppppp') + console.log(props.flowPermission) + // return $func.arrToStr(props.flowPermission) || '所有人' + return props.flowPermission.name || userStore.name } - return $func.copyerStr(props.nodeConfig) + if (props.nodeConfig.type == 1) { + return $func.setApproverStr(props.nodeConfig) // 审批 + } + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index edac0e5..6f516aa 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -202,6 +202,18 @@ activeMenu: '/process/list', }, }, + { + path: 'add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, ], }, { diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index e133fdb..5758df9 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -89,11 +89,20 @@ label: '逾期未检定', value: 'yqwjd', }, -] +]// 检定结果 +const mesureResultMap = { + hg: '合格', + xhhg: '修后合格', + xy: '限用', + zy: '准用', + bhg: '不合格', + lj: '漏检', + yqwjd: '逾期未检定', +}// 检定结果字典 const mesureTypeList = [ { - label: '外检', - value: 'wj', + label: '自检', + value: 'zj', }, { label: '外包', @@ -337,30 +346,32 @@ const getInfo = () => { getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'wj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // } + // res.data = { + // ABC: 'A', + // companyAddress: '北京/北京市', + // customerName: '京东集团', + // customerNo: 'sygf202211290001', + // id: '', + // labelBind: '11222', + // manufacturer: '北京某厂家', + // manufacturerCountry: 'CN', + // manufacturingDate: '2023-03', + // manufacturingNo: '123121', + // mesureCategory: 'jd', + // mesureContent: '项目1', + // mesurePeriod: '1', + // mesureType: 'zj', + // minioFileName: '小程序工期表-1117_1674961769128.xlsx', + // phone: '950618', + // postalCode: 'test', + // remark: '无备注', + // sampleModel: '型号1', + // sampleName: '样品1', + // sampleNo: '', + // measureResultCode: 'bhg', + // } dataForm.value = res.data + dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] for (const item of menu) { item.searchFunc() } @@ -599,7 +610,13 @@ - + - + - + diff --git a/src/views/customer/sample/list/list.vue b/src/views/customer/sample/list/list.vue index 3d46b46..08dc008 100644 --- a/src/views/customer/sample/list/list.vue +++ b/src/views/customer/sample/list/list.vue @@ -47,33 +47,46 @@ const fileRef = ref() // 数据查询 function fetchData(isNowPage = false) { - loadingTable.value = true + // loadingTable.value = true if (!isNowPage) { // 是否显示当前页,否则跳转第一页 listQuery.value.offset = 1 } listQuery.value.startTime = timeRange.value[0] as string || '' listQuery.value.endTime = timeRange.value[1] as string || '' - getSampleList(listQuery.value).then((response) => { - // 模拟数据 + // getSampleList(listQuery.value).then((response) => { + // 模拟数据 - // response.data.rows = [ - // { - // id: '1597579843411234817', - // sampleNo: '1', // 样品编号 - // sampleName: '1', // 样品名称 - // sampleModel: '1', // 型号 - // evaluationName: '1', // 出厂编号 - // customerId: '1', // 委托方代码 - // customerName: '1', // 委托方名称 - // mesurePeriod: '1', // 检定周期 - // effectiveDate: '1', // 上次检定时间 - // remark: '备注', // 备注 - // }] - list.value = response.data.rows - total.value = parseInt(response.data.total) - loadingTable.value = false - }) + // response.data.rows = [ + // { + // id: '1597579843411234817', + // sampleNo: '1', // 样品编号 + // sampleName: '1', // 样品名称 + // sampleModel: '1', // 型号 + // evaluationName: '1', // 出厂编号 + // customerId: '1', // 委托方代码 + // customerName: '1', // 委托方名称 + // mesurePeriod: '1', // 检定周期 + // effectiveDate: '1', // 上次检定时间 + // remark: '备注', // 备注 + // }] + // list.value = response.data.rows + // total.value = parseInt(response.data.total) + // loadingTable.value = false + // }) + list.value = [ + { + id: '1597579843411234817', + sampleNo: '1', // 样品编号 + sampleName: '1', // 样品名称 + sampleModel: '1', // 型号 + evaluationName: '1', // 出厂编号 + customerId: '1', // 委托方代码 + customerName: '1', // 委托方名称 + mesurePeriod: '1', // 检定周期 + effectiveDate: '1', // 上次检定时间 + remark: '备注', // 备注 + }] } // 多选发生改变时 function handleSelectionChange(e: any) { diff --git a/src/api/system/process.ts b/src/api/system/process.ts index f1f5e7b..e459424 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -49,7 +49,7 @@ } // 流程定义编辑 -export function efitProcess(params: Object) { +export function editProcess(params: Object) { const param = { _value: params, } @@ -60,6 +60,18 @@ }) } +// 新建流程 +export function addProcess(params: Object) { + const param = { + _value: params, + } + return request({ + url: `${prefix}/jsonToBpmn`, + method: 'post', + data: param, + }) +} + // 获取流程定义详情 export function getProcessDetail(formId: string) { const param = { @@ -100,7 +112,7 @@ beginTime: string endTime: string status: string - ids: string[] + // ids: string[] }) { return request({ url: `${prefix}/listExport`, diff --git a/src/components/dialog/selectEmployeesDialog.vue b/src/components/dialog/selectEmployeesDialog.vue index dc67b48..6db84db 100644 --- a/src/components/dialog/selectEmployeesDialog.vue +++ b/src/components/dialog/selectEmployeesDialog.vue @@ -76,7 +76,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map(item => ({ ...item, - type: 2, // type是啥 + type: 1, // type: 1.成员 2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/dialog/selectRoleDialog.vue b/src/components/dialog/selectRoleDialog.vue index 38881f4..64f51ae 100644 --- a/src/components/dialog/selectRoleDialog.vue +++ b/src/components/dialog/selectRoleDialog.vue @@ -71,7 +71,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map((item: any) => ({ ...item, - type: 2, // type是啥 + type: 2, // type:1.成员,2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/drawer/approverDrawer.vue b/src/components/drawer/approverDrawer.vue index 0f8a37d..7f5cd2f 100644 --- a/src/components/drawer/approverDrawer.vue +++ b/src/components/drawer/approverDrawer.vue @@ -148,9 +148,6 @@ return } - // if (approverConfig.value.settype === 11) { - // approverConfig.value.settype = 1 - // } // 把审批设置反应在流程图里面 approverConfig.value.error = !$func.setApproverStr(approverConfig.value) // 保存设置 diff --git a/src/components/workFlow/nodeWrap.vue b/src/components/workFlow/nodeWrap.vue index a97f752..90bc3ad 100644 --- a/src/components/workFlow/nodeWrap.vue +++ b/src/components/workFlow/nodeWrap.vue @@ -28,14 +28,15 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { - return userStore.name - // return $func.arrToStr(props.flowPermission) || '所有人' + if (props.nodeConfig.type == 0) { // 发起人 + // return userStore.name + // return $func.arrToStr(props.flowPermission) || userStore.name + return props.flowPermission.name || userStore.name } - if (props.nodeConfig.type == 1) { + if (props.nodeConfig.type == 1) { // 审批 return $func.setApproverStr(props.nodeConfig) } - return $func.copyerStr(props.nodeConfig) + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/components/workFlow/nodeWrapBan.vue b/src/components/workFlow/nodeWrapBan.vue index 2de6650..457d9ab 100644 --- a/src/components/workFlow/nodeWrapBan.vue +++ b/src/components/workFlow/nodeWrapBan.vue @@ -25,11 +25,16 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { return $func.arrToStr(props.flowPermission) || '所有人' } - if (props.nodeConfig.type == 1) { - return $func.setApproverStr(props.nodeConfig) + if (props.nodeConfig.type == 0) { + console.log('pppppppp') + console.log(props.flowPermission) + // return $func.arrToStr(props.flowPermission) || '所有人' + return props.flowPermission.name || userStore.name } - return $func.copyerStr(props.nodeConfig) + if (props.nodeConfig.type == 1) { + return $func.setApproverStr(props.nodeConfig) // 审批 + } + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index edac0e5..6f516aa 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -202,6 +202,18 @@ activeMenu: '/process/list', }, }, + { + path: 'add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, ], }, { diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index e133fdb..5758df9 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -89,11 +89,20 @@ label: '逾期未检定', value: 'yqwjd', }, -] +]// 检定结果 +const mesureResultMap = { + hg: '合格', + xhhg: '修后合格', + xy: '限用', + zy: '准用', + bhg: '不合格', + lj: '漏检', + yqwjd: '逾期未检定', +}// 检定结果字典 const mesureTypeList = [ { - label: '外检', - value: 'wj', + label: '自检', + value: 'zj', }, { label: '外包', @@ -337,30 +346,32 @@ const getInfo = () => { getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'wj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // } + // res.data = { + // ABC: 'A', + // companyAddress: '北京/北京市', + // customerName: '京东集团', + // customerNo: 'sygf202211290001', + // id: '', + // labelBind: '11222', + // manufacturer: '北京某厂家', + // manufacturerCountry: 'CN', + // manufacturingDate: '2023-03', + // manufacturingNo: '123121', + // mesureCategory: 'jd', + // mesureContent: '项目1', + // mesurePeriod: '1', + // mesureType: 'zj', + // minioFileName: '小程序工期表-1117_1674961769128.xlsx', + // phone: '950618', + // postalCode: 'test', + // remark: '无备注', + // sampleModel: '型号1', + // sampleName: '样品1', + // sampleNo: '', + // measureResultCode: 'bhg', + // } dataForm.value = res.data + dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] for (const item of menu) { item.searchFunc() } @@ -599,7 +610,13 @@ - + - + - + diff --git a/src/views/customer/sample/list/list.vue b/src/views/customer/sample/list/list.vue index 3d46b46..08dc008 100644 --- a/src/views/customer/sample/list/list.vue +++ b/src/views/customer/sample/list/list.vue @@ -47,33 +47,46 @@ const fileRef = ref() // 数据查询 function fetchData(isNowPage = false) { - loadingTable.value = true + // loadingTable.value = true if (!isNowPage) { // 是否显示当前页,否则跳转第一页 listQuery.value.offset = 1 } listQuery.value.startTime = timeRange.value[0] as string || '' listQuery.value.endTime = timeRange.value[1] as string || '' - getSampleList(listQuery.value).then((response) => { - // 模拟数据 + // getSampleList(listQuery.value).then((response) => { + // 模拟数据 - // response.data.rows = [ - // { - // id: '1597579843411234817', - // sampleNo: '1', // 样品编号 - // sampleName: '1', // 样品名称 - // sampleModel: '1', // 型号 - // evaluationName: '1', // 出厂编号 - // customerId: '1', // 委托方代码 - // customerName: '1', // 委托方名称 - // mesurePeriod: '1', // 检定周期 - // effectiveDate: '1', // 上次检定时间 - // remark: '备注', // 备注 - // }] - list.value = response.data.rows - total.value = parseInt(response.data.total) - loadingTable.value = false - }) + // response.data.rows = [ + // { + // id: '1597579843411234817', + // sampleNo: '1', // 样品编号 + // sampleName: '1', // 样品名称 + // sampleModel: '1', // 型号 + // evaluationName: '1', // 出厂编号 + // customerId: '1', // 委托方代码 + // customerName: '1', // 委托方名称 + // mesurePeriod: '1', // 检定周期 + // effectiveDate: '1', // 上次检定时间 + // remark: '备注', // 备注 + // }] + // list.value = response.data.rows + // total.value = parseInt(response.data.total) + // loadingTable.value = false + // }) + list.value = [ + { + id: '1597579843411234817', + sampleNo: '1', // 样品编号 + sampleName: '1', // 样品名称 + sampleModel: '1', // 型号 + evaluationName: '1', // 出厂编号 + customerId: '1', // 委托方代码 + customerName: '1', // 委托方名称 + mesurePeriod: '1', // 检定周期 + effectiveDate: '1', // 上次检定时间 + remark: '备注', // 备注 + }] } // 多选发生改变时 function handleSelectionChange(e: any) { diff --git a/src/views/customer/sample/list/sample_list_interface.ts b/src/views/customer/sample/list/sample_list_interface.ts index f8c4555..f5d0514 100644 --- a/src/views/customer/sample/list/sample_list_interface.ts +++ b/src/views/customer/sample/list/sample_list_interface.ts @@ -47,6 +47,10 @@ minioFileName: string // 说明书 labelBind: string // 标签绑定 mesureType: string // 检定方式 + measureDate?: string // 检定日期 + effectiveDate?: string // 有效日期 + measureResultCode?: string // 检定结果代码 + measureResult?: string // 检定结果 } // 检定记录 diff --git a/src/api/system/process.ts b/src/api/system/process.ts index f1f5e7b..e459424 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -49,7 +49,7 @@ } // 流程定义编辑 -export function efitProcess(params: Object) { +export function editProcess(params: Object) { const param = { _value: params, } @@ -60,6 +60,18 @@ }) } +// 新建流程 +export function addProcess(params: Object) { + const param = { + _value: params, + } + return request({ + url: `${prefix}/jsonToBpmn`, + method: 'post', + data: param, + }) +} + // 获取流程定义详情 export function getProcessDetail(formId: string) { const param = { @@ -100,7 +112,7 @@ beginTime: string endTime: string status: string - ids: string[] + // ids: string[] }) { return request({ url: `${prefix}/listExport`, diff --git a/src/components/dialog/selectEmployeesDialog.vue b/src/components/dialog/selectEmployeesDialog.vue index dc67b48..6db84db 100644 --- a/src/components/dialog/selectEmployeesDialog.vue +++ b/src/components/dialog/selectEmployeesDialog.vue @@ -76,7 +76,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map(item => ({ ...item, - type: 2, // type是啥 + type: 1, // type: 1.成员 2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/dialog/selectRoleDialog.vue b/src/components/dialog/selectRoleDialog.vue index 38881f4..64f51ae 100644 --- a/src/components/dialog/selectRoleDialog.vue +++ b/src/components/dialog/selectRoleDialog.vue @@ -71,7 +71,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map((item: any) => ({ ...item, - type: 2, // type是啥 + type: 2, // type:1.成员,2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/drawer/approverDrawer.vue b/src/components/drawer/approverDrawer.vue index 0f8a37d..7f5cd2f 100644 --- a/src/components/drawer/approverDrawer.vue +++ b/src/components/drawer/approverDrawer.vue @@ -148,9 +148,6 @@ return } - // if (approverConfig.value.settype === 11) { - // approverConfig.value.settype = 1 - // } // 把审批设置反应在流程图里面 approverConfig.value.error = !$func.setApproverStr(approverConfig.value) // 保存设置 diff --git a/src/components/workFlow/nodeWrap.vue b/src/components/workFlow/nodeWrap.vue index a97f752..90bc3ad 100644 --- a/src/components/workFlow/nodeWrap.vue +++ b/src/components/workFlow/nodeWrap.vue @@ -28,14 +28,15 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { - return userStore.name - // return $func.arrToStr(props.flowPermission) || '所有人' + if (props.nodeConfig.type == 0) { // 发起人 + // return userStore.name + // return $func.arrToStr(props.flowPermission) || userStore.name + return props.flowPermission.name || userStore.name } - if (props.nodeConfig.type == 1) { + if (props.nodeConfig.type == 1) { // 审批 return $func.setApproverStr(props.nodeConfig) } - return $func.copyerStr(props.nodeConfig) + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/components/workFlow/nodeWrapBan.vue b/src/components/workFlow/nodeWrapBan.vue index 2de6650..457d9ab 100644 --- a/src/components/workFlow/nodeWrapBan.vue +++ b/src/components/workFlow/nodeWrapBan.vue @@ -25,11 +25,16 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { return $func.arrToStr(props.flowPermission) || '所有人' } - if (props.nodeConfig.type == 1) { - return $func.setApproverStr(props.nodeConfig) + if (props.nodeConfig.type == 0) { + console.log('pppppppp') + console.log(props.flowPermission) + // return $func.arrToStr(props.flowPermission) || '所有人' + return props.flowPermission.name || userStore.name } - return $func.copyerStr(props.nodeConfig) + if (props.nodeConfig.type == 1) { + return $func.setApproverStr(props.nodeConfig) // 审批 + } + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index edac0e5..6f516aa 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -202,6 +202,18 @@ activeMenu: '/process/list', }, }, + { + path: 'add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, ], }, { diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index e133fdb..5758df9 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -89,11 +89,20 @@ label: '逾期未检定', value: 'yqwjd', }, -] +]// 检定结果 +const mesureResultMap = { + hg: '合格', + xhhg: '修后合格', + xy: '限用', + zy: '准用', + bhg: '不合格', + lj: '漏检', + yqwjd: '逾期未检定', +}// 检定结果字典 const mesureTypeList = [ { - label: '外检', - value: 'wj', + label: '自检', + value: 'zj', }, { label: '外包', @@ -337,30 +346,32 @@ const getInfo = () => { getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'wj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // } + // res.data = { + // ABC: 'A', + // companyAddress: '北京/北京市', + // customerName: '京东集团', + // customerNo: 'sygf202211290001', + // id: '', + // labelBind: '11222', + // manufacturer: '北京某厂家', + // manufacturerCountry: 'CN', + // manufacturingDate: '2023-03', + // manufacturingNo: '123121', + // mesureCategory: 'jd', + // mesureContent: '项目1', + // mesurePeriod: '1', + // mesureType: 'zj', + // minioFileName: '小程序工期表-1117_1674961769128.xlsx', + // phone: '950618', + // postalCode: 'test', + // remark: '无备注', + // sampleModel: '型号1', + // sampleName: '样品1', + // sampleNo: '', + // measureResultCode: 'bhg', + // } dataForm.value = res.data + dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] for (const item of menu) { item.searchFunc() } @@ -599,7 +610,13 @@ - + - + - + diff --git a/src/views/customer/sample/list/list.vue b/src/views/customer/sample/list/list.vue index 3d46b46..08dc008 100644 --- a/src/views/customer/sample/list/list.vue +++ b/src/views/customer/sample/list/list.vue @@ -47,33 +47,46 @@ const fileRef = ref() // 数据查询 function fetchData(isNowPage = false) { - loadingTable.value = true + // loadingTable.value = true if (!isNowPage) { // 是否显示当前页,否则跳转第一页 listQuery.value.offset = 1 } listQuery.value.startTime = timeRange.value[0] as string || '' listQuery.value.endTime = timeRange.value[1] as string || '' - getSampleList(listQuery.value).then((response) => { - // 模拟数据 + // getSampleList(listQuery.value).then((response) => { + // 模拟数据 - // response.data.rows = [ - // { - // id: '1597579843411234817', - // sampleNo: '1', // 样品编号 - // sampleName: '1', // 样品名称 - // sampleModel: '1', // 型号 - // evaluationName: '1', // 出厂编号 - // customerId: '1', // 委托方代码 - // customerName: '1', // 委托方名称 - // mesurePeriod: '1', // 检定周期 - // effectiveDate: '1', // 上次检定时间 - // remark: '备注', // 备注 - // }] - list.value = response.data.rows - total.value = parseInt(response.data.total) - loadingTable.value = false - }) + // response.data.rows = [ + // { + // id: '1597579843411234817', + // sampleNo: '1', // 样品编号 + // sampleName: '1', // 样品名称 + // sampleModel: '1', // 型号 + // evaluationName: '1', // 出厂编号 + // customerId: '1', // 委托方代码 + // customerName: '1', // 委托方名称 + // mesurePeriod: '1', // 检定周期 + // effectiveDate: '1', // 上次检定时间 + // remark: '备注', // 备注 + // }] + // list.value = response.data.rows + // total.value = parseInt(response.data.total) + // loadingTable.value = false + // }) + list.value = [ + { + id: '1597579843411234817', + sampleNo: '1', // 样品编号 + sampleName: '1', // 样品名称 + sampleModel: '1', // 型号 + evaluationName: '1', // 出厂编号 + customerId: '1', // 委托方代码 + customerName: '1', // 委托方名称 + mesurePeriod: '1', // 检定周期 + effectiveDate: '1', // 上次检定时间 + remark: '备注', // 备注 + }] } // 多选发生改变时 function handleSelectionChange(e: any) { diff --git a/src/views/customer/sample/list/sample_list_interface.ts b/src/views/customer/sample/list/sample_list_interface.ts index f8c4555..f5d0514 100644 --- a/src/views/customer/sample/list/sample_list_interface.ts +++ b/src/views/customer/sample/list/sample_list_interface.ts @@ -47,6 +47,10 @@ minioFileName: string // 说明书 labelBind: string // 标签绑定 mesureType: string // 检定方式 + measureDate?: string // 检定日期 + effectiveDate?: string // 有效日期 + measureResultCode?: string // 检定结果代码 + measureResult?: string // 检定结果 } // 检定记录 diff --git a/src/views/setting.vue b/src/views/setting.vue index c03a0bf..fb59203 100644 --- a/src/views/setting.vue +++ b/src/views/setting.vue @@ -8,7 +8,7 @@ import approverDrawer from '@/components/drawer/approverDrawer.vue' import copyerDrawer from '@/components/drawer/copyerDrawer.vue' import conditionDrawer from '@/components/drawer/conditionDrawer.vue' -import { efitProcess, getDirectorLevel, getProcessDetail, unloadProcess } from '@/api/system/process' +import { addProcess, editProcess, getDirectorLevel, getProcessDetail, unloadProcess } from '@/api/system/process' import userStore from '@/store/modules/user' const props = defineProps({ allowEditNode: { @@ -20,6 +20,10 @@ default: () => {}, }, selectFormId: String, + isAddProcess: { + type: Boolean, + default: false, + }, }) const user = userStore() @@ -38,31 +42,58 @@ return res.data } onMounted(async () => { - const res = await getDirectorLevel('1615620539758731266') - console.log('=====', res, user.id) - let max - // const res = await getDirectorLevel(user.id) - if (res.code === 200) { + let max = 0 // 审批主管最大层级 + + // 获取此用户的审批主管的最大层级 + getDirectorLevel(user.id).then((res) => { max = res.data.level - } + }) const route = useRoute() - nextTick(() => { - initDetail(props.selectFormId).then((data) => { - processConfig.value = data - const { - nodeConfig: nodes, - flowPermission: flows, - directorMaxLevel: directors, - workFlowDef: works, - tableId, - } = data - nodeConfig.value = nodes - flowPermission.value = flows - // directorMaxLevel.value = directors - directorMaxLevel.value = max - workFlowDef.value = works - workFlowStore.setTableId(tableId) - }) + nextTick(async () => { + let data + if (!props.isAddProcess) { // 非新建流程--调流程详情接口 + data = await initDetail(props.selectFormId) + } + else { // 新建流程 + data = { + tableId: 1, + workFlowDef: { + name: '合同审批', + }, + directorMaxLevel: max, + flowPermission: [], + nodeConfig: { + nodeName: '发起人', + type: 0, + priorityLevel: '', + settype: '', + selectMode: '', + selectRange: '', + directorLevel: '', + examineMode: '', + noHanderAction: '', + examineEndDirectorLevel: '', + ccSelfSelectFlag: '', + conditionList: [], + nodeUserList: [], + conditionNodes: [], + }, + } + } + processConfig.value = data + const { + nodeConfig: nodes, + flowPermission: flows, + directorMaxLevel: directors, + workFlowDef: works, + tableId, + } = data + nodeConfig.value = nodes + flowPermission.value = flows + // directorMaxLevel.value = directors + directorMaxLevel.value = max + workFlowDef.value = works + workFlowStore.setTableId(tableId) }) }) const toReturn = () => { @@ -100,13 +131,24 @@ } } const saveSet = async () => { - processConfig.value.formId = props.getRowData.formId - processConfig.value.formName = props.getRowData.formName - processConfig.value.formDesc = props.getRowData.formDesc - processConfig.value.formContent = props.getRowData.formDesc - processConfig.value.workFlowDef.flowKey = props.getRowData.flowKey - processConfig.value.workFlowDef.directorId = props.getRowData.directorId - processConfig.value.workFlowDef.name = props.getRowData.name + if (!props.isAddProcess) { + processConfig.value.formId = props.getRowData.formId + processConfig.value.formName = props.getRowData.formName + processConfig.value.formDesc = props.getRowData.formDesc + processConfig.value.formContent = props.getRowData.formDesc + processConfig.value.workFlowDef.flowKey = props.getRowData.flowKey + processConfig.value.workFlowDef.directorId = props.getRowData.directorId + processConfig.value.workFlowDef.name = props.getRowData.name + } + else { + processConfig.value.formId = props.getRowData.formID + processConfig.value.formName = props.getRowData.business + processConfig.value.formDesc = props.getRowData.desc + processConfig.value.formContent = props.getRowData.desc + processConfig.value.workFlowDef.directorId = user.id + processConfig.value.workFlowDef.name = props.getRowData.name + } + workFlowStore.setIsTried(true) tipList.value = [] reErr(nodeConfig.value) @@ -115,11 +157,25 @@ tipVisible.value = true return } - processConfig.value.flowPermission = flowPermission.value - const res = await efitProcess(processConfig.value) - if (res.code == 200) { - ElMessage.success('保存成功') + if (!props.isAddProcess) { + // processConfig.value.flowPermission = flowPermission.value //编辑时不允许改发起人 + const res = await editProcess(processConfig.value) + if (res.code == 200) { + ElMessage.success('编辑流程成功') + } + } + else { + processConfig.value.flowPermission = { // 新建时发起人是此时的用户 + name: user.name, // 用户名 + targetId: user.id, // 用户id + type: 1, // 成员 + } + + const res = await addProcess(processConfig.value) + if (res.code == 200) { + ElMessage.success('创建流程成功') + } } } defineExpose({ diff --git a/src/api/system/process.ts b/src/api/system/process.ts index f1f5e7b..e459424 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -49,7 +49,7 @@ } // 流程定义编辑 -export function efitProcess(params: Object) { +export function editProcess(params: Object) { const param = { _value: params, } @@ -60,6 +60,18 @@ }) } +// 新建流程 +export function addProcess(params: Object) { + const param = { + _value: params, + } + return request({ + url: `${prefix}/jsonToBpmn`, + method: 'post', + data: param, + }) +} + // 获取流程定义详情 export function getProcessDetail(formId: string) { const param = { @@ -100,7 +112,7 @@ beginTime: string endTime: string status: string - ids: string[] + // ids: string[] }) { return request({ url: `${prefix}/listExport`, diff --git a/src/components/dialog/selectEmployeesDialog.vue b/src/components/dialog/selectEmployeesDialog.vue index dc67b48..6db84db 100644 --- a/src/components/dialog/selectEmployeesDialog.vue +++ b/src/components/dialog/selectEmployeesDialog.vue @@ -76,7 +76,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map(item => ({ ...item, - type: 2, // type是啥 + type: 1, // type: 1.成员 2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/dialog/selectRoleDialog.vue b/src/components/dialog/selectRoleDialog.vue index 38881f4..64f51ae 100644 --- a/src/components/dialog/selectRoleDialog.vue +++ b/src/components/dialog/selectRoleDialog.vue @@ -71,7 +71,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map((item: any) => ({ ...item, - type: 2, // type是啥 + type: 2, // type:1.成员,2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/drawer/approverDrawer.vue b/src/components/drawer/approverDrawer.vue index 0f8a37d..7f5cd2f 100644 --- a/src/components/drawer/approverDrawer.vue +++ b/src/components/drawer/approverDrawer.vue @@ -148,9 +148,6 @@ return } - // if (approverConfig.value.settype === 11) { - // approverConfig.value.settype = 1 - // } // 把审批设置反应在流程图里面 approverConfig.value.error = !$func.setApproverStr(approverConfig.value) // 保存设置 diff --git a/src/components/workFlow/nodeWrap.vue b/src/components/workFlow/nodeWrap.vue index a97f752..90bc3ad 100644 --- a/src/components/workFlow/nodeWrap.vue +++ b/src/components/workFlow/nodeWrap.vue @@ -28,14 +28,15 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { - return userStore.name - // return $func.arrToStr(props.flowPermission) || '所有人' + if (props.nodeConfig.type == 0) { // 发起人 + // return userStore.name + // return $func.arrToStr(props.flowPermission) || userStore.name + return props.flowPermission.name || userStore.name } - if (props.nodeConfig.type == 1) { + if (props.nodeConfig.type == 1) { // 审批 return $func.setApproverStr(props.nodeConfig) } - return $func.copyerStr(props.nodeConfig) + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/components/workFlow/nodeWrapBan.vue b/src/components/workFlow/nodeWrapBan.vue index 2de6650..457d9ab 100644 --- a/src/components/workFlow/nodeWrapBan.vue +++ b/src/components/workFlow/nodeWrapBan.vue @@ -25,11 +25,16 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { return $func.arrToStr(props.flowPermission) || '所有人' } - if (props.nodeConfig.type == 1) { - return $func.setApproverStr(props.nodeConfig) + if (props.nodeConfig.type == 0) { + console.log('pppppppp') + console.log(props.flowPermission) + // return $func.arrToStr(props.flowPermission) || '所有人' + return props.flowPermission.name || userStore.name } - return $func.copyerStr(props.nodeConfig) + if (props.nodeConfig.type == 1) { + return $func.setApproverStr(props.nodeConfig) // 审批 + } + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index edac0e5..6f516aa 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -202,6 +202,18 @@ activeMenu: '/process/list', }, }, + { + path: 'add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, ], }, { diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index e133fdb..5758df9 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -89,11 +89,20 @@ label: '逾期未检定', value: 'yqwjd', }, -] +]// 检定结果 +const mesureResultMap = { + hg: '合格', + xhhg: '修后合格', + xy: '限用', + zy: '准用', + bhg: '不合格', + lj: '漏检', + yqwjd: '逾期未检定', +}// 检定结果字典 const mesureTypeList = [ { - label: '外检', - value: 'wj', + label: '自检', + value: 'zj', }, { label: '外包', @@ -337,30 +346,32 @@ const getInfo = () => { getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'wj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // } + // res.data = { + // ABC: 'A', + // companyAddress: '北京/北京市', + // customerName: '京东集团', + // customerNo: 'sygf202211290001', + // id: '', + // labelBind: '11222', + // manufacturer: '北京某厂家', + // manufacturerCountry: 'CN', + // manufacturingDate: '2023-03', + // manufacturingNo: '123121', + // mesureCategory: 'jd', + // mesureContent: '项目1', + // mesurePeriod: '1', + // mesureType: 'zj', + // minioFileName: '小程序工期表-1117_1674961769128.xlsx', + // phone: '950618', + // postalCode: 'test', + // remark: '无备注', + // sampleModel: '型号1', + // sampleName: '样品1', + // sampleNo: '', + // measureResultCode: 'bhg', + // } dataForm.value = res.data + dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] for (const item of menu) { item.searchFunc() } @@ -599,7 +610,13 @@ - + - + - + diff --git a/src/views/customer/sample/list/list.vue b/src/views/customer/sample/list/list.vue index 3d46b46..08dc008 100644 --- a/src/views/customer/sample/list/list.vue +++ b/src/views/customer/sample/list/list.vue @@ -47,33 +47,46 @@ const fileRef = ref() // 数据查询 function fetchData(isNowPage = false) { - loadingTable.value = true + // loadingTable.value = true if (!isNowPage) { // 是否显示当前页,否则跳转第一页 listQuery.value.offset = 1 } listQuery.value.startTime = timeRange.value[0] as string || '' listQuery.value.endTime = timeRange.value[1] as string || '' - getSampleList(listQuery.value).then((response) => { - // 模拟数据 + // getSampleList(listQuery.value).then((response) => { + // 模拟数据 - // response.data.rows = [ - // { - // id: '1597579843411234817', - // sampleNo: '1', // 样品编号 - // sampleName: '1', // 样品名称 - // sampleModel: '1', // 型号 - // evaluationName: '1', // 出厂编号 - // customerId: '1', // 委托方代码 - // customerName: '1', // 委托方名称 - // mesurePeriod: '1', // 检定周期 - // effectiveDate: '1', // 上次检定时间 - // remark: '备注', // 备注 - // }] - list.value = response.data.rows - total.value = parseInt(response.data.total) - loadingTable.value = false - }) + // response.data.rows = [ + // { + // id: '1597579843411234817', + // sampleNo: '1', // 样品编号 + // sampleName: '1', // 样品名称 + // sampleModel: '1', // 型号 + // evaluationName: '1', // 出厂编号 + // customerId: '1', // 委托方代码 + // customerName: '1', // 委托方名称 + // mesurePeriod: '1', // 检定周期 + // effectiveDate: '1', // 上次检定时间 + // remark: '备注', // 备注 + // }] + // list.value = response.data.rows + // total.value = parseInt(response.data.total) + // loadingTable.value = false + // }) + list.value = [ + { + id: '1597579843411234817', + sampleNo: '1', // 样品编号 + sampleName: '1', // 样品名称 + sampleModel: '1', // 型号 + evaluationName: '1', // 出厂编号 + customerId: '1', // 委托方代码 + customerName: '1', // 委托方名称 + mesurePeriod: '1', // 检定周期 + effectiveDate: '1', // 上次检定时间 + remark: '备注', // 备注 + }] } // 多选发生改变时 function handleSelectionChange(e: any) { diff --git a/src/views/customer/sample/list/sample_list_interface.ts b/src/views/customer/sample/list/sample_list_interface.ts index f8c4555..f5d0514 100644 --- a/src/views/customer/sample/list/sample_list_interface.ts +++ b/src/views/customer/sample/list/sample_list_interface.ts @@ -47,6 +47,10 @@ minioFileName: string // 说明书 labelBind: string // 标签绑定 mesureType: string // 检定方式 + measureDate?: string // 检定日期 + effectiveDate?: string // 有效日期 + measureResultCode?: string // 检定结果代码 + measureResult?: string // 检定结果 } // 检定记录 diff --git a/src/views/setting.vue b/src/views/setting.vue index c03a0bf..fb59203 100644 --- a/src/views/setting.vue +++ b/src/views/setting.vue @@ -8,7 +8,7 @@ import approverDrawer from '@/components/drawer/approverDrawer.vue' import copyerDrawer from '@/components/drawer/copyerDrawer.vue' import conditionDrawer from '@/components/drawer/conditionDrawer.vue' -import { efitProcess, getDirectorLevel, getProcessDetail, unloadProcess } from '@/api/system/process' +import { addProcess, editProcess, getDirectorLevel, getProcessDetail, unloadProcess } from '@/api/system/process' import userStore from '@/store/modules/user' const props = defineProps({ allowEditNode: { @@ -20,6 +20,10 @@ default: () => {}, }, selectFormId: String, + isAddProcess: { + type: Boolean, + default: false, + }, }) const user = userStore() @@ -38,31 +42,58 @@ return res.data } onMounted(async () => { - const res = await getDirectorLevel('1615620539758731266') - console.log('=====', res, user.id) - let max - // const res = await getDirectorLevel(user.id) - if (res.code === 200) { + let max = 0 // 审批主管最大层级 + + // 获取此用户的审批主管的最大层级 + getDirectorLevel(user.id).then((res) => { max = res.data.level - } + }) const route = useRoute() - nextTick(() => { - initDetail(props.selectFormId).then((data) => { - processConfig.value = data - const { - nodeConfig: nodes, - flowPermission: flows, - directorMaxLevel: directors, - workFlowDef: works, - tableId, - } = data - nodeConfig.value = nodes - flowPermission.value = flows - // directorMaxLevel.value = directors - directorMaxLevel.value = max - workFlowDef.value = works - workFlowStore.setTableId(tableId) - }) + nextTick(async () => { + let data + if (!props.isAddProcess) { // 非新建流程--调流程详情接口 + data = await initDetail(props.selectFormId) + } + else { // 新建流程 + data = { + tableId: 1, + workFlowDef: { + name: '合同审批', + }, + directorMaxLevel: max, + flowPermission: [], + nodeConfig: { + nodeName: '发起人', + type: 0, + priorityLevel: '', + settype: '', + selectMode: '', + selectRange: '', + directorLevel: '', + examineMode: '', + noHanderAction: '', + examineEndDirectorLevel: '', + ccSelfSelectFlag: '', + conditionList: [], + nodeUserList: [], + conditionNodes: [], + }, + } + } + processConfig.value = data + const { + nodeConfig: nodes, + flowPermission: flows, + directorMaxLevel: directors, + workFlowDef: works, + tableId, + } = data + nodeConfig.value = nodes + flowPermission.value = flows + // directorMaxLevel.value = directors + directorMaxLevel.value = max + workFlowDef.value = works + workFlowStore.setTableId(tableId) }) }) const toReturn = () => { @@ -100,13 +131,24 @@ } } const saveSet = async () => { - processConfig.value.formId = props.getRowData.formId - processConfig.value.formName = props.getRowData.formName - processConfig.value.formDesc = props.getRowData.formDesc - processConfig.value.formContent = props.getRowData.formDesc - processConfig.value.workFlowDef.flowKey = props.getRowData.flowKey - processConfig.value.workFlowDef.directorId = props.getRowData.directorId - processConfig.value.workFlowDef.name = props.getRowData.name + if (!props.isAddProcess) { + processConfig.value.formId = props.getRowData.formId + processConfig.value.formName = props.getRowData.formName + processConfig.value.formDesc = props.getRowData.formDesc + processConfig.value.formContent = props.getRowData.formDesc + processConfig.value.workFlowDef.flowKey = props.getRowData.flowKey + processConfig.value.workFlowDef.directorId = props.getRowData.directorId + processConfig.value.workFlowDef.name = props.getRowData.name + } + else { + processConfig.value.formId = props.getRowData.formID + processConfig.value.formName = props.getRowData.business + processConfig.value.formDesc = props.getRowData.desc + processConfig.value.formContent = props.getRowData.desc + processConfig.value.workFlowDef.directorId = user.id + processConfig.value.workFlowDef.name = props.getRowData.name + } + workFlowStore.setIsTried(true) tipList.value = [] reErr(nodeConfig.value) @@ -115,11 +157,25 @@ tipVisible.value = true return } - processConfig.value.flowPermission = flowPermission.value - const res = await efitProcess(processConfig.value) - if (res.code == 200) { - ElMessage.success('保存成功') + if (!props.isAddProcess) { + // processConfig.value.flowPermission = flowPermission.value //编辑时不允许改发起人 + const res = await editProcess(processConfig.value) + if (res.code == 200) { + ElMessage.success('编辑流程成功') + } + } + else { + processConfig.value.flowPermission = { // 新建时发起人是此时的用户 + name: user.name, // 用户名 + targetId: user.id, // 用户id + type: 1, // 成员 + } + + const res = await addProcess(processConfig.value) + if (res.code == 200) { + ElMessage.success('创建流程成功') + } } } defineExpose({ diff --git a/src/views/system/process/addProcess.vue b/src/views/system/process/addProcess.vue new file mode 100644 index 0000000..f840c40 --- /dev/null +++ b/src/views/system/process/addProcess.vue @@ -0,0 +1,258 @@ + + + + + + diff --git a/src/api/system/process.ts b/src/api/system/process.ts index f1f5e7b..e459424 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -49,7 +49,7 @@ } // 流程定义编辑 -export function efitProcess(params: Object) { +export function editProcess(params: Object) { const param = { _value: params, } @@ -60,6 +60,18 @@ }) } +// 新建流程 +export function addProcess(params: Object) { + const param = { + _value: params, + } + return request({ + url: `${prefix}/jsonToBpmn`, + method: 'post', + data: param, + }) +} + // 获取流程定义详情 export function getProcessDetail(formId: string) { const param = { @@ -100,7 +112,7 @@ beginTime: string endTime: string status: string - ids: string[] + // ids: string[] }) { return request({ url: `${prefix}/listExport`, diff --git a/src/components/dialog/selectEmployeesDialog.vue b/src/components/dialog/selectEmployeesDialog.vue index dc67b48..6db84db 100644 --- a/src/components/dialog/selectEmployeesDialog.vue +++ b/src/components/dialog/selectEmployeesDialog.vue @@ -76,7 +76,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map(item => ({ ...item, - type: 2, // type是啥 + type: 1, // type: 1.成员 2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/dialog/selectRoleDialog.vue b/src/components/dialog/selectRoleDialog.vue index 38881f4..64f51ae 100644 --- a/src/components/dialog/selectRoleDialog.vue +++ b/src/components/dialog/selectRoleDialog.vue @@ -71,7 +71,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map((item: any) => ({ ...item, - type: 2, // type是啥 + type: 2, // type:1.成员,2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/drawer/approverDrawer.vue b/src/components/drawer/approverDrawer.vue index 0f8a37d..7f5cd2f 100644 --- a/src/components/drawer/approverDrawer.vue +++ b/src/components/drawer/approverDrawer.vue @@ -148,9 +148,6 @@ return } - // if (approverConfig.value.settype === 11) { - // approverConfig.value.settype = 1 - // } // 把审批设置反应在流程图里面 approverConfig.value.error = !$func.setApproverStr(approverConfig.value) // 保存设置 diff --git a/src/components/workFlow/nodeWrap.vue b/src/components/workFlow/nodeWrap.vue index a97f752..90bc3ad 100644 --- a/src/components/workFlow/nodeWrap.vue +++ b/src/components/workFlow/nodeWrap.vue @@ -28,14 +28,15 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { - return userStore.name - // return $func.arrToStr(props.flowPermission) || '所有人' + if (props.nodeConfig.type == 0) { // 发起人 + // return userStore.name + // return $func.arrToStr(props.flowPermission) || userStore.name + return props.flowPermission.name || userStore.name } - if (props.nodeConfig.type == 1) { + if (props.nodeConfig.type == 1) { // 审批 return $func.setApproverStr(props.nodeConfig) } - return $func.copyerStr(props.nodeConfig) + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/components/workFlow/nodeWrapBan.vue b/src/components/workFlow/nodeWrapBan.vue index 2de6650..457d9ab 100644 --- a/src/components/workFlow/nodeWrapBan.vue +++ b/src/components/workFlow/nodeWrapBan.vue @@ -25,11 +25,16 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { return $func.arrToStr(props.flowPermission) || '所有人' } - if (props.nodeConfig.type == 1) { - return $func.setApproverStr(props.nodeConfig) + if (props.nodeConfig.type == 0) { + console.log('pppppppp') + console.log(props.flowPermission) + // return $func.arrToStr(props.flowPermission) || '所有人' + return props.flowPermission.name || userStore.name } - return $func.copyerStr(props.nodeConfig) + if (props.nodeConfig.type == 1) { + return $func.setApproverStr(props.nodeConfig) // 审批 + } + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index edac0e5..6f516aa 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -202,6 +202,18 @@ activeMenu: '/process/list', }, }, + { + path: 'add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, ], }, { diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index e133fdb..5758df9 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -89,11 +89,20 @@ label: '逾期未检定', value: 'yqwjd', }, -] +]// 检定结果 +const mesureResultMap = { + hg: '合格', + xhhg: '修后合格', + xy: '限用', + zy: '准用', + bhg: '不合格', + lj: '漏检', + yqwjd: '逾期未检定', +}// 检定结果字典 const mesureTypeList = [ { - label: '外检', - value: 'wj', + label: '自检', + value: 'zj', }, { label: '外包', @@ -337,30 +346,32 @@ const getInfo = () => { getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'wj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // } + // res.data = { + // ABC: 'A', + // companyAddress: '北京/北京市', + // customerName: '京东集团', + // customerNo: 'sygf202211290001', + // id: '', + // labelBind: '11222', + // manufacturer: '北京某厂家', + // manufacturerCountry: 'CN', + // manufacturingDate: '2023-03', + // manufacturingNo: '123121', + // mesureCategory: 'jd', + // mesureContent: '项目1', + // mesurePeriod: '1', + // mesureType: 'zj', + // minioFileName: '小程序工期表-1117_1674961769128.xlsx', + // phone: '950618', + // postalCode: 'test', + // remark: '无备注', + // sampleModel: '型号1', + // sampleName: '样品1', + // sampleNo: '', + // measureResultCode: 'bhg', + // } dataForm.value = res.data + dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] for (const item of menu) { item.searchFunc() } @@ -599,7 +610,13 @@ - + - + - + diff --git a/src/views/customer/sample/list/list.vue b/src/views/customer/sample/list/list.vue index 3d46b46..08dc008 100644 --- a/src/views/customer/sample/list/list.vue +++ b/src/views/customer/sample/list/list.vue @@ -47,33 +47,46 @@ const fileRef = ref() // 数据查询 function fetchData(isNowPage = false) { - loadingTable.value = true + // loadingTable.value = true if (!isNowPage) { // 是否显示当前页,否则跳转第一页 listQuery.value.offset = 1 } listQuery.value.startTime = timeRange.value[0] as string || '' listQuery.value.endTime = timeRange.value[1] as string || '' - getSampleList(listQuery.value).then((response) => { - // 模拟数据 + // getSampleList(listQuery.value).then((response) => { + // 模拟数据 - // response.data.rows = [ - // { - // id: '1597579843411234817', - // sampleNo: '1', // 样品编号 - // sampleName: '1', // 样品名称 - // sampleModel: '1', // 型号 - // evaluationName: '1', // 出厂编号 - // customerId: '1', // 委托方代码 - // customerName: '1', // 委托方名称 - // mesurePeriod: '1', // 检定周期 - // effectiveDate: '1', // 上次检定时间 - // remark: '备注', // 备注 - // }] - list.value = response.data.rows - total.value = parseInt(response.data.total) - loadingTable.value = false - }) + // response.data.rows = [ + // { + // id: '1597579843411234817', + // sampleNo: '1', // 样品编号 + // sampleName: '1', // 样品名称 + // sampleModel: '1', // 型号 + // evaluationName: '1', // 出厂编号 + // customerId: '1', // 委托方代码 + // customerName: '1', // 委托方名称 + // mesurePeriod: '1', // 检定周期 + // effectiveDate: '1', // 上次检定时间 + // remark: '备注', // 备注 + // }] + // list.value = response.data.rows + // total.value = parseInt(response.data.total) + // loadingTable.value = false + // }) + list.value = [ + { + id: '1597579843411234817', + sampleNo: '1', // 样品编号 + sampleName: '1', // 样品名称 + sampleModel: '1', // 型号 + evaluationName: '1', // 出厂编号 + customerId: '1', // 委托方代码 + customerName: '1', // 委托方名称 + mesurePeriod: '1', // 检定周期 + effectiveDate: '1', // 上次检定时间 + remark: '备注', // 备注 + }] } // 多选发生改变时 function handleSelectionChange(e: any) { diff --git a/src/views/customer/sample/list/sample_list_interface.ts b/src/views/customer/sample/list/sample_list_interface.ts index f8c4555..f5d0514 100644 --- a/src/views/customer/sample/list/sample_list_interface.ts +++ b/src/views/customer/sample/list/sample_list_interface.ts @@ -47,6 +47,10 @@ minioFileName: string // 说明书 labelBind: string // 标签绑定 mesureType: string // 检定方式 + measureDate?: string // 检定日期 + effectiveDate?: string // 有效日期 + measureResultCode?: string // 检定结果代码 + measureResult?: string // 检定结果 } // 检定记录 diff --git a/src/views/setting.vue b/src/views/setting.vue index c03a0bf..fb59203 100644 --- a/src/views/setting.vue +++ b/src/views/setting.vue @@ -8,7 +8,7 @@ import approverDrawer from '@/components/drawer/approverDrawer.vue' import copyerDrawer from '@/components/drawer/copyerDrawer.vue' import conditionDrawer from '@/components/drawer/conditionDrawer.vue' -import { efitProcess, getDirectorLevel, getProcessDetail, unloadProcess } from '@/api/system/process' +import { addProcess, editProcess, getDirectorLevel, getProcessDetail, unloadProcess } from '@/api/system/process' import userStore from '@/store/modules/user' const props = defineProps({ allowEditNode: { @@ -20,6 +20,10 @@ default: () => {}, }, selectFormId: String, + isAddProcess: { + type: Boolean, + default: false, + }, }) const user = userStore() @@ -38,31 +42,58 @@ return res.data } onMounted(async () => { - const res = await getDirectorLevel('1615620539758731266') - console.log('=====', res, user.id) - let max - // const res = await getDirectorLevel(user.id) - if (res.code === 200) { + let max = 0 // 审批主管最大层级 + + // 获取此用户的审批主管的最大层级 + getDirectorLevel(user.id).then((res) => { max = res.data.level - } + }) const route = useRoute() - nextTick(() => { - initDetail(props.selectFormId).then((data) => { - processConfig.value = data - const { - nodeConfig: nodes, - flowPermission: flows, - directorMaxLevel: directors, - workFlowDef: works, - tableId, - } = data - nodeConfig.value = nodes - flowPermission.value = flows - // directorMaxLevel.value = directors - directorMaxLevel.value = max - workFlowDef.value = works - workFlowStore.setTableId(tableId) - }) + nextTick(async () => { + let data + if (!props.isAddProcess) { // 非新建流程--调流程详情接口 + data = await initDetail(props.selectFormId) + } + else { // 新建流程 + data = { + tableId: 1, + workFlowDef: { + name: '合同审批', + }, + directorMaxLevel: max, + flowPermission: [], + nodeConfig: { + nodeName: '发起人', + type: 0, + priorityLevel: '', + settype: '', + selectMode: '', + selectRange: '', + directorLevel: '', + examineMode: '', + noHanderAction: '', + examineEndDirectorLevel: '', + ccSelfSelectFlag: '', + conditionList: [], + nodeUserList: [], + conditionNodes: [], + }, + } + } + processConfig.value = data + const { + nodeConfig: nodes, + flowPermission: flows, + directorMaxLevel: directors, + workFlowDef: works, + tableId, + } = data + nodeConfig.value = nodes + flowPermission.value = flows + // directorMaxLevel.value = directors + directorMaxLevel.value = max + workFlowDef.value = works + workFlowStore.setTableId(tableId) }) }) const toReturn = () => { @@ -100,13 +131,24 @@ } } const saveSet = async () => { - processConfig.value.formId = props.getRowData.formId - processConfig.value.formName = props.getRowData.formName - processConfig.value.formDesc = props.getRowData.formDesc - processConfig.value.formContent = props.getRowData.formDesc - processConfig.value.workFlowDef.flowKey = props.getRowData.flowKey - processConfig.value.workFlowDef.directorId = props.getRowData.directorId - processConfig.value.workFlowDef.name = props.getRowData.name + if (!props.isAddProcess) { + processConfig.value.formId = props.getRowData.formId + processConfig.value.formName = props.getRowData.formName + processConfig.value.formDesc = props.getRowData.formDesc + processConfig.value.formContent = props.getRowData.formDesc + processConfig.value.workFlowDef.flowKey = props.getRowData.flowKey + processConfig.value.workFlowDef.directorId = props.getRowData.directorId + processConfig.value.workFlowDef.name = props.getRowData.name + } + else { + processConfig.value.formId = props.getRowData.formID + processConfig.value.formName = props.getRowData.business + processConfig.value.formDesc = props.getRowData.desc + processConfig.value.formContent = props.getRowData.desc + processConfig.value.workFlowDef.directorId = user.id + processConfig.value.workFlowDef.name = props.getRowData.name + } + workFlowStore.setIsTried(true) tipList.value = [] reErr(nodeConfig.value) @@ -115,11 +157,25 @@ tipVisible.value = true return } - processConfig.value.flowPermission = flowPermission.value - const res = await efitProcess(processConfig.value) - if (res.code == 200) { - ElMessage.success('保存成功') + if (!props.isAddProcess) { + // processConfig.value.flowPermission = flowPermission.value //编辑时不允许改发起人 + const res = await editProcess(processConfig.value) + if (res.code == 200) { + ElMessage.success('编辑流程成功') + } + } + else { + processConfig.value.flowPermission = { // 新建时发起人是此时的用户 + name: user.name, // 用户名 + targetId: user.id, // 用户id + type: 1, // 成员 + } + + const res = await addProcess(processConfig.value) + if (res.code == 200) { + ElMessage.success('创建流程成功') + } } } defineExpose({ diff --git a/src/views/system/process/addProcess.vue b/src/views/system/process/addProcess.vue new file mode 100644 index 0000000..f840c40 --- /dev/null +++ b/src/views/system/process/addProcess.vue @@ -0,0 +1,258 @@ + + + + + + diff --git a/src/views/system/process/detailProcess.vue b/src/views/system/process/detailProcess.vue index e1daeca..9fedcbb 100644 --- a/src/views/system/process/detailProcess.vue +++ b/src/views/system/process/detailProcess.vue @@ -11,11 +11,12 @@ const $route = useRoute() const selectFormId = ref('') const ruleFormRef = ref() +const getRowData = ref({}) as any const form: Ref = ref({ - number: '11111', // 编号 - name: '111', // 名称 - business: 'sss', // 关联业务 - desc: '2', // 流程描述 + number: '', // 编号 + name: '', // 名称 + business: '', // 关联业务 + desc: '', // 流程描述 selectDecision: '同意 驳回 拒绝', // 选择的决策 rejectTo: '2', // 可驳回至 changeData: '2', // 驳回修改数据 @@ -73,10 +74,12 @@ onMounted(() => { const rowData: any = $route.query.rowData - // console.log('111111', JSON.parse(rowData)) - const data = JSON.parse(rowData) - selectFormId.value = data.formId - console.log('selectFormId', selectFormId.value) + getRowData.value = JSON.parse(rowData) + selectFormId.value = getRowData.value.formId + form.value.number = getRowData.value.number + form.value.name = getRowData.value.name + form.value.business = getRowData.value.business + form.value.desc = getRowData.value.describe }) @@ -92,9 +95,10 @@ - {{ form.number }} + + - + - + - {{ form.name }} + + + - + + - {{ form.business }} + + + - + diff --git a/src/api/system/process.ts b/src/api/system/process.ts index f1f5e7b..e459424 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -49,7 +49,7 @@ } // 流程定义编辑 -export function efitProcess(params: Object) { +export function editProcess(params: Object) { const param = { _value: params, } @@ -60,6 +60,18 @@ }) } +// 新建流程 +export function addProcess(params: Object) { + const param = { + _value: params, + } + return request({ + url: `${prefix}/jsonToBpmn`, + method: 'post', + data: param, + }) +} + // 获取流程定义详情 export function getProcessDetail(formId: string) { const param = { @@ -100,7 +112,7 @@ beginTime: string endTime: string status: string - ids: string[] + // ids: string[] }) { return request({ url: `${prefix}/listExport`, diff --git a/src/components/dialog/selectEmployeesDialog.vue b/src/components/dialog/selectEmployeesDialog.vue index dc67b48..6db84db 100644 --- a/src/components/dialog/selectEmployeesDialog.vue +++ b/src/components/dialog/selectEmployeesDialog.vue @@ -76,7 +76,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map(item => ({ ...item, - type: 2, // type是啥 + type: 1, // type: 1.成员 2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/dialog/selectRoleDialog.vue b/src/components/dialog/selectRoleDialog.vue index 38881f4..64f51ae 100644 --- a/src/components/dialog/selectRoleDialog.vue +++ b/src/components/dialog/selectRoleDialog.vue @@ -71,7 +71,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map((item: any) => ({ ...item, - type: 2, // type是啥 + type: 2, // type:1.成员,2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/drawer/approverDrawer.vue b/src/components/drawer/approverDrawer.vue index 0f8a37d..7f5cd2f 100644 --- a/src/components/drawer/approverDrawer.vue +++ b/src/components/drawer/approverDrawer.vue @@ -148,9 +148,6 @@ return } - // if (approverConfig.value.settype === 11) { - // approverConfig.value.settype = 1 - // } // 把审批设置反应在流程图里面 approverConfig.value.error = !$func.setApproverStr(approverConfig.value) // 保存设置 diff --git a/src/components/workFlow/nodeWrap.vue b/src/components/workFlow/nodeWrap.vue index a97f752..90bc3ad 100644 --- a/src/components/workFlow/nodeWrap.vue +++ b/src/components/workFlow/nodeWrap.vue @@ -28,14 +28,15 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { - return userStore.name - // return $func.arrToStr(props.flowPermission) || '所有人' + if (props.nodeConfig.type == 0) { // 发起人 + // return userStore.name + // return $func.arrToStr(props.flowPermission) || userStore.name + return props.flowPermission.name || userStore.name } - if (props.nodeConfig.type == 1) { + if (props.nodeConfig.type == 1) { // 审批 return $func.setApproverStr(props.nodeConfig) } - return $func.copyerStr(props.nodeConfig) + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/components/workFlow/nodeWrapBan.vue b/src/components/workFlow/nodeWrapBan.vue index 2de6650..457d9ab 100644 --- a/src/components/workFlow/nodeWrapBan.vue +++ b/src/components/workFlow/nodeWrapBan.vue @@ -25,11 +25,16 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { return $func.arrToStr(props.flowPermission) || '所有人' } - if (props.nodeConfig.type == 1) { - return $func.setApproverStr(props.nodeConfig) + if (props.nodeConfig.type == 0) { + console.log('pppppppp') + console.log(props.flowPermission) + // return $func.arrToStr(props.flowPermission) || '所有人' + return props.flowPermission.name || userStore.name } - return $func.copyerStr(props.nodeConfig) + if (props.nodeConfig.type == 1) { + return $func.setApproverStr(props.nodeConfig) // 审批 + } + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index edac0e5..6f516aa 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -202,6 +202,18 @@ activeMenu: '/process/list', }, }, + { + path: 'add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, ], }, { diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index e133fdb..5758df9 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -89,11 +89,20 @@ label: '逾期未检定', value: 'yqwjd', }, -] +]// 检定结果 +const mesureResultMap = { + hg: '合格', + xhhg: '修后合格', + xy: '限用', + zy: '准用', + bhg: '不合格', + lj: '漏检', + yqwjd: '逾期未检定', +}// 检定结果字典 const mesureTypeList = [ { - label: '外检', - value: 'wj', + label: '自检', + value: 'zj', }, { label: '外包', @@ -337,30 +346,32 @@ const getInfo = () => { getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'wj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // } + // res.data = { + // ABC: 'A', + // companyAddress: '北京/北京市', + // customerName: '京东集团', + // customerNo: 'sygf202211290001', + // id: '', + // labelBind: '11222', + // manufacturer: '北京某厂家', + // manufacturerCountry: 'CN', + // manufacturingDate: '2023-03', + // manufacturingNo: '123121', + // mesureCategory: 'jd', + // mesureContent: '项目1', + // mesurePeriod: '1', + // mesureType: 'zj', + // minioFileName: '小程序工期表-1117_1674961769128.xlsx', + // phone: '950618', + // postalCode: 'test', + // remark: '无备注', + // sampleModel: '型号1', + // sampleName: '样品1', + // sampleNo: '', + // measureResultCode: 'bhg', + // } dataForm.value = res.data + dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] for (const item of menu) { item.searchFunc() } @@ -599,7 +610,13 @@ - + - + - + diff --git a/src/views/customer/sample/list/list.vue b/src/views/customer/sample/list/list.vue index 3d46b46..08dc008 100644 --- a/src/views/customer/sample/list/list.vue +++ b/src/views/customer/sample/list/list.vue @@ -47,33 +47,46 @@ const fileRef = ref() // 数据查询 function fetchData(isNowPage = false) { - loadingTable.value = true + // loadingTable.value = true if (!isNowPage) { // 是否显示当前页,否则跳转第一页 listQuery.value.offset = 1 } listQuery.value.startTime = timeRange.value[0] as string || '' listQuery.value.endTime = timeRange.value[1] as string || '' - getSampleList(listQuery.value).then((response) => { - // 模拟数据 + // getSampleList(listQuery.value).then((response) => { + // 模拟数据 - // response.data.rows = [ - // { - // id: '1597579843411234817', - // sampleNo: '1', // 样品编号 - // sampleName: '1', // 样品名称 - // sampleModel: '1', // 型号 - // evaluationName: '1', // 出厂编号 - // customerId: '1', // 委托方代码 - // customerName: '1', // 委托方名称 - // mesurePeriod: '1', // 检定周期 - // effectiveDate: '1', // 上次检定时间 - // remark: '备注', // 备注 - // }] - list.value = response.data.rows - total.value = parseInt(response.data.total) - loadingTable.value = false - }) + // response.data.rows = [ + // { + // id: '1597579843411234817', + // sampleNo: '1', // 样品编号 + // sampleName: '1', // 样品名称 + // sampleModel: '1', // 型号 + // evaluationName: '1', // 出厂编号 + // customerId: '1', // 委托方代码 + // customerName: '1', // 委托方名称 + // mesurePeriod: '1', // 检定周期 + // effectiveDate: '1', // 上次检定时间 + // remark: '备注', // 备注 + // }] + // list.value = response.data.rows + // total.value = parseInt(response.data.total) + // loadingTable.value = false + // }) + list.value = [ + { + id: '1597579843411234817', + sampleNo: '1', // 样品编号 + sampleName: '1', // 样品名称 + sampleModel: '1', // 型号 + evaluationName: '1', // 出厂编号 + customerId: '1', // 委托方代码 + customerName: '1', // 委托方名称 + mesurePeriod: '1', // 检定周期 + effectiveDate: '1', // 上次检定时间 + remark: '备注', // 备注 + }] } // 多选发生改变时 function handleSelectionChange(e: any) { diff --git a/src/views/customer/sample/list/sample_list_interface.ts b/src/views/customer/sample/list/sample_list_interface.ts index f8c4555..f5d0514 100644 --- a/src/views/customer/sample/list/sample_list_interface.ts +++ b/src/views/customer/sample/list/sample_list_interface.ts @@ -47,6 +47,10 @@ minioFileName: string // 说明书 labelBind: string // 标签绑定 mesureType: string // 检定方式 + measureDate?: string // 检定日期 + effectiveDate?: string // 有效日期 + measureResultCode?: string // 检定结果代码 + measureResult?: string // 检定结果 } // 检定记录 diff --git a/src/views/setting.vue b/src/views/setting.vue index c03a0bf..fb59203 100644 --- a/src/views/setting.vue +++ b/src/views/setting.vue @@ -8,7 +8,7 @@ import approverDrawer from '@/components/drawer/approverDrawer.vue' import copyerDrawer from '@/components/drawer/copyerDrawer.vue' import conditionDrawer from '@/components/drawer/conditionDrawer.vue' -import { efitProcess, getDirectorLevel, getProcessDetail, unloadProcess } from '@/api/system/process' +import { addProcess, editProcess, getDirectorLevel, getProcessDetail, unloadProcess } from '@/api/system/process' import userStore from '@/store/modules/user' const props = defineProps({ allowEditNode: { @@ -20,6 +20,10 @@ default: () => {}, }, selectFormId: String, + isAddProcess: { + type: Boolean, + default: false, + }, }) const user = userStore() @@ -38,31 +42,58 @@ return res.data } onMounted(async () => { - const res = await getDirectorLevel('1615620539758731266') - console.log('=====', res, user.id) - let max - // const res = await getDirectorLevel(user.id) - if (res.code === 200) { + let max = 0 // 审批主管最大层级 + + // 获取此用户的审批主管的最大层级 + getDirectorLevel(user.id).then((res) => { max = res.data.level - } + }) const route = useRoute() - nextTick(() => { - initDetail(props.selectFormId).then((data) => { - processConfig.value = data - const { - nodeConfig: nodes, - flowPermission: flows, - directorMaxLevel: directors, - workFlowDef: works, - tableId, - } = data - nodeConfig.value = nodes - flowPermission.value = flows - // directorMaxLevel.value = directors - directorMaxLevel.value = max - workFlowDef.value = works - workFlowStore.setTableId(tableId) - }) + nextTick(async () => { + let data + if (!props.isAddProcess) { // 非新建流程--调流程详情接口 + data = await initDetail(props.selectFormId) + } + else { // 新建流程 + data = { + tableId: 1, + workFlowDef: { + name: '合同审批', + }, + directorMaxLevel: max, + flowPermission: [], + nodeConfig: { + nodeName: '发起人', + type: 0, + priorityLevel: '', + settype: '', + selectMode: '', + selectRange: '', + directorLevel: '', + examineMode: '', + noHanderAction: '', + examineEndDirectorLevel: '', + ccSelfSelectFlag: '', + conditionList: [], + nodeUserList: [], + conditionNodes: [], + }, + } + } + processConfig.value = data + const { + nodeConfig: nodes, + flowPermission: flows, + directorMaxLevel: directors, + workFlowDef: works, + tableId, + } = data + nodeConfig.value = nodes + flowPermission.value = flows + // directorMaxLevel.value = directors + directorMaxLevel.value = max + workFlowDef.value = works + workFlowStore.setTableId(tableId) }) }) const toReturn = () => { @@ -100,13 +131,24 @@ } } const saveSet = async () => { - processConfig.value.formId = props.getRowData.formId - processConfig.value.formName = props.getRowData.formName - processConfig.value.formDesc = props.getRowData.formDesc - processConfig.value.formContent = props.getRowData.formDesc - processConfig.value.workFlowDef.flowKey = props.getRowData.flowKey - processConfig.value.workFlowDef.directorId = props.getRowData.directorId - processConfig.value.workFlowDef.name = props.getRowData.name + if (!props.isAddProcess) { + processConfig.value.formId = props.getRowData.formId + processConfig.value.formName = props.getRowData.formName + processConfig.value.formDesc = props.getRowData.formDesc + processConfig.value.formContent = props.getRowData.formDesc + processConfig.value.workFlowDef.flowKey = props.getRowData.flowKey + processConfig.value.workFlowDef.directorId = props.getRowData.directorId + processConfig.value.workFlowDef.name = props.getRowData.name + } + else { + processConfig.value.formId = props.getRowData.formID + processConfig.value.formName = props.getRowData.business + processConfig.value.formDesc = props.getRowData.desc + processConfig.value.formContent = props.getRowData.desc + processConfig.value.workFlowDef.directorId = user.id + processConfig.value.workFlowDef.name = props.getRowData.name + } + workFlowStore.setIsTried(true) tipList.value = [] reErr(nodeConfig.value) @@ -115,11 +157,25 @@ tipVisible.value = true return } - processConfig.value.flowPermission = flowPermission.value - const res = await efitProcess(processConfig.value) - if (res.code == 200) { - ElMessage.success('保存成功') + if (!props.isAddProcess) { + // processConfig.value.flowPermission = flowPermission.value //编辑时不允许改发起人 + const res = await editProcess(processConfig.value) + if (res.code == 200) { + ElMessage.success('编辑流程成功') + } + } + else { + processConfig.value.flowPermission = { // 新建时发起人是此时的用户 + name: user.name, // 用户名 + targetId: user.id, // 用户id + type: 1, // 成员 + } + + const res = await addProcess(processConfig.value) + if (res.code == 200) { + ElMessage.success('创建流程成功') + } } } defineExpose({ diff --git a/src/views/system/process/addProcess.vue b/src/views/system/process/addProcess.vue new file mode 100644 index 0000000..f840c40 --- /dev/null +++ b/src/views/system/process/addProcess.vue @@ -0,0 +1,258 @@ + + + + + + diff --git a/src/views/system/process/detailProcess.vue b/src/views/system/process/detailProcess.vue index e1daeca..9fedcbb 100644 --- a/src/views/system/process/detailProcess.vue +++ b/src/views/system/process/detailProcess.vue @@ -11,11 +11,12 @@ const $route = useRoute() const selectFormId = ref('') const ruleFormRef = ref() +const getRowData = ref({}) as any const form: Ref = ref({ - number: '11111', // 编号 - name: '111', // 名称 - business: 'sss', // 关联业务 - desc: '2', // 流程描述 + number: '', // 编号 + name: '', // 名称 + business: '', // 关联业务 + desc: '', // 流程描述 selectDecision: '同意 驳回 拒绝', // 选择的决策 rejectTo: '2', // 可驳回至 changeData: '2', // 驳回修改数据 @@ -73,10 +74,12 @@ onMounted(() => { const rowData: any = $route.query.rowData - // console.log('111111', JSON.parse(rowData)) - const data = JSON.parse(rowData) - selectFormId.value = data.formId - console.log('selectFormId', selectFormId.value) + getRowData.value = JSON.parse(rowData) + selectFormId.value = getRowData.value.formId + form.value.number = getRowData.value.number + form.value.name = getRowData.value.name + form.value.business = getRowData.value.business + form.value.desc = getRowData.value.describe }) @@ -92,9 +95,10 @@ - {{ form.number }} + + - + - + - {{ form.name }} + + + - + + - {{ form.business }} + + + - + diff --git a/src/views/system/process/editProcess.vue b/src/views/system/process/editProcess.vue index ec793e0..330dda1 100644 --- a/src/views/system/process/editProcess.vue +++ b/src/views/system/process/editProcess.vue @@ -11,7 +11,7 @@ const processSetting = ref() const selectFormId = ref('') // formid const $route = useRoute() -const getRowData = ref({}) +const getRowData = ref({}) as any const ruleFormRef = ref() const form: Ref = ref({ number: '', // 编号 @@ -133,7 +133,6 @@ onMounted(() => { const rowData: any = $route.query.rowData - console.log('111111', JSON.parse(rowData)) getRowData.value = JSON.parse(rowData) selectFormId.value = getRowData.value.formId form.value.number = getRowData.value.number @@ -159,9 +158,10 @@ - {{ form.number }} + + - + - + + - {{ form.name }} + - + + - {{ form.business }} + + - + diff --git a/src/api/system/process.ts b/src/api/system/process.ts index f1f5e7b..e459424 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -49,7 +49,7 @@ } // 流程定义编辑 -export function efitProcess(params: Object) { +export function editProcess(params: Object) { const param = { _value: params, } @@ -60,6 +60,18 @@ }) } +// 新建流程 +export function addProcess(params: Object) { + const param = { + _value: params, + } + return request({ + url: `${prefix}/jsonToBpmn`, + method: 'post', + data: param, + }) +} + // 获取流程定义详情 export function getProcessDetail(formId: string) { const param = { @@ -100,7 +112,7 @@ beginTime: string endTime: string status: string - ids: string[] + // ids: string[] }) { return request({ url: `${prefix}/listExport`, diff --git a/src/components/dialog/selectEmployeesDialog.vue b/src/components/dialog/selectEmployeesDialog.vue index dc67b48..6db84db 100644 --- a/src/components/dialog/selectEmployeesDialog.vue +++ b/src/components/dialog/selectEmployeesDialog.vue @@ -76,7 +76,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map(item => ({ ...item, - type: 2, // type是啥 + type: 1, // type: 1.成员 2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/dialog/selectRoleDialog.vue b/src/components/dialog/selectRoleDialog.vue index 38881f4..64f51ae 100644 --- a/src/components/dialog/selectRoleDialog.vue +++ b/src/components/dialog/selectRoleDialog.vue @@ -71,7 +71,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map((item: any) => ({ ...item, - type: 2, // type是啥 + type: 2, // type:1.成员,2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/drawer/approverDrawer.vue b/src/components/drawer/approverDrawer.vue index 0f8a37d..7f5cd2f 100644 --- a/src/components/drawer/approverDrawer.vue +++ b/src/components/drawer/approverDrawer.vue @@ -148,9 +148,6 @@ return } - // if (approverConfig.value.settype === 11) { - // approverConfig.value.settype = 1 - // } // 把审批设置反应在流程图里面 approverConfig.value.error = !$func.setApproverStr(approverConfig.value) // 保存设置 diff --git a/src/components/workFlow/nodeWrap.vue b/src/components/workFlow/nodeWrap.vue index a97f752..90bc3ad 100644 --- a/src/components/workFlow/nodeWrap.vue +++ b/src/components/workFlow/nodeWrap.vue @@ -28,14 +28,15 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { - return userStore.name - // return $func.arrToStr(props.flowPermission) || '所有人' + if (props.nodeConfig.type == 0) { // 发起人 + // return userStore.name + // return $func.arrToStr(props.flowPermission) || userStore.name + return props.flowPermission.name || userStore.name } - if (props.nodeConfig.type == 1) { + if (props.nodeConfig.type == 1) { // 审批 return $func.setApproverStr(props.nodeConfig) } - return $func.copyerStr(props.nodeConfig) + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/components/workFlow/nodeWrapBan.vue b/src/components/workFlow/nodeWrapBan.vue index 2de6650..457d9ab 100644 --- a/src/components/workFlow/nodeWrapBan.vue +++ b/src/components/workFlow/nodeWrapBan.vue @@ -25,11 +25,16 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { return $func.arrToStr(props.flowPermission) || '所有人' } - if (props.nodeConfig.type == 1) { - return $func.setApproverStr(props.nodeConfig) + if (props.nodeConfig.type == 0) { + console.log('pppppppp') + console.log(props.flowPermission) + // return $func.arrToStr(props.flowPermission) || '所有人' + return props.flowPermission.name || userStore.name } - return $func.copyerStr(props.nodeConfig) + if (props.nodeConfig.type == 1) { + return $func.setApproverStr(props.nodeConfig) // 审批 + } + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index edac0e5..6f516aa 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -202,6 +202,18 @@ activeMenu: '/process/list', }, }, + { + path: 'add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, ], }, { diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index e133fdb..5758df9 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -89,11 +89,20 @@ label: '逾期未检定', value: 'yqwjd', }, -] +]// 检定结果 +const mesureResultMap = { + hg: '合格', + xhhg: '修后合格', + xy: '限用', + zy: '准用', + bhg: '不合格', + lj: '漏检', + yqwjd: '逾期未检定', +}// 检定结果字典 const mesureTypeList = [ { - label: '外检', - value: 'wj', + label: '自检', + value: 'zj', }, { label: '外包', @@ -337,30 +346,32 @@ const getInfo = () => { getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'wj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // } + // res.data = { + // ABC: 'A', + // companyAddress: '北京/北京市', + // customerName: '京东集团', + // customerNo: 'sygf202211290001', + // id: '', + // labelBind: '11222', + // manufacturer: '北京某厂家', + // manufacturerCountry: 'CN', + // manufacturingDate: '2023-03', + // manufacturingNo: '123121', + // mesureCategory: 'jd', + // mesureContent: '项目1', + // mesurePeriod: '1', + // mesureType: 'zj', + // minioFileName: '小程序工期表-1117_1674961769128.xlsx', + // phone: '950618', + // postalCode: 'test', + // remark: '无备注', + // sampleModel: '型号1', + // sampleName: '样品1', + // sampleNo: '', + // measureResultCode: 'bhg', + // } dataForm.value = res.data + dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] for (const item of menu) { item.searchFunc() } @@ -599,7 +610,13 @@ - + - + - + diff --git a/src/views/customer/sample/list/list.vue b/src/views/customer/sample/list/list.vue index 3d46b46..08dc008 100644 --- a/src/views/customer/sample/list/list.vue +++ b/src/views/customer/sample/list/list.vue @@ -47,33 +47,46 @@ const fileRef = ref() // 数据查询 function fetchData(isNowPage = false) { - loadingTable.value = true + // loadingTable.value = true if (!isNowPage) { // 是否显示当前页,否则跳转第一页 listQuery.value.offset = 1 } listQuery.value.startTime = timeRange.value[0] as string || '' listQuery.value.endTime = timeRange.value[1] as string || '' - getSampleList(listQuery.value).then((response) => { - // 模拟数据 + // getSampleList(listQuery.value).then((response) => { + // 模拟数据 - // response.data.rows = [ - // { - // id: '1597579843411234817', - // sampleNo: '1', // 样品编号 - // sampleName: '1', // 样品名称 - // sampleModel: '1', // 型号 - // evaluationName: '1', // 出厂编号 - // customerId: '1', // 委托方代码 - // customerName: '1', // 委托方名称 - // mesurePeriod: '1', // 检定周期 - // effectiveDate: '1', // 上次检定时间 - // remark: '备注', // 备注 - // }] - list.value = response.data.rows - total.value = parseInt(response.data.total) - loadingTable.value = false - }) + // response.data.rows = [ + // { + // id: '1597579843411234817', + // sampleNo: '1', // 样品编号 + // sampleName: '1', // 样品名称 + // sampleModel: '1', // 型号 + // evaluationName: '1', // 出厂编号 + // customerId: '1', // 委托方代码 + // customerName: '1', // 委托方名称 + // mesurePeriod: '1', // 检定周期 + // effectiveDate: '1', // 上次检定时间 + // remark: '备注', // 备注 + // }] + // list.value = response.data.rows + // total.value = parseInt(response.data.total) + // loadingTable.value = false + // }) + list.value = [ + { + id: '1597579843411234817', + sampleNo: '1', // 样品编号 + sampleName: '1', // 样品名称 + sampleModel: '1', // 型号 + evaluationName: '1', // 出厂编号 + customerId: '1', // 委托方代码 + customerName: '1', // 委托方名称 + mesurePeriod: '1', // 检定周期 + effectiveDate: '1', // 上次检定时间 + remark: '备注', // 备注 + }] } // 多选发生改变时 function handleSelectionChange(e: any) { diff --git a/src/views/customer/sample/list/sample_list_interface.ts b/src/views/customer/sample/list/sample_list_interface.ts index f8c4555..f5d0514 100644 --- a/src/views/customer/sample/list/sample_list_interface.ts +++ b/src/views/customer/sample/list/sample_list_interface.ts @@ -47,6 +47,10 @@ minioFileName: string // 说明书 labelBind: string // 标签绑定 mesureType: string // 检定方式 + measureDate?: string // 检定日期 + effectiveDate?: string // 有效日期 + measureResultCode?: string // 检定结果代码 + measureResult?: string // 检定结果 } // 检定记录 diff --git a/src/views/setting.vue b/src/views/setting.vue index c03a0bf..fb59203 100644 --- a/src/views/setting.vue +++ b/src/views/setting.vue @@ -8,7 +8,7 @@ import approverDrawer from '@/components/drawer/approverDrawer.vue' import copyerDrawer from '@/components/drawer/copyerDrawer.vue' import conditionDrawer from '@/components/drawer/conditionDrawer.vue' -import { efitProcess, getDirectorLevel, getProcessDetail, unloadProcess } from '@/api/system/process' +import { addProcess, editProcess, getDirectorLevel, getProcessDetail, unloadProcess } from '@/api/system/process' import userStore from '@/store/modules/user' const props = defineProps({ allowEditNode: { @@ -20,6 +20,10 @@ default: () => {}, }, selectFormId: String, + isAddProcess: { + type: Boolean, + default: false, + }, }) const user = userStore() @@ -38,31 +42,58 @@ return res.data } onMounted(async () => { - const res = await getDirectorLevel('1615620539758731266') - console.log('=====', res, user.id) - let max - // const res = await getDirectorLevel(user.id) - if (res.code === 200) { + let max = 0 // 审批主管最大层级 + + // 获取此用户的审批主管的最大层级 + getDirectorLevel(user.id).then((res) => { max = res.data.level - } + }) const route = useRoute() - nextTick(() => { - initDetail(props.selectFormId).then((data) => { - processConfig.value = data - const { - nodeConfig: nodes, - flowPermission: flows, - directorMaxLevel: directors, - workFlowDef: works, - tableId, - } = data - nodeConfig.value = nodes - flowPermission.value = flows - // directorMaxLevel.value = directors - directorMaxLevel.value = max - workFlowDef.value = works - workFlowStore.setTableId(tableId) - }) + nextTick(async () => { + let data + if (!props.isAddProcess) { // 非新建流程--调流程详情接口 + data = await initDetail(props.selectFormId) + } + else { // 新建流程 + data = { + tableId: 1, + workFlowDef: { + name: '合同审批', + }, + directorMaxLevel: max, + flowPermission: [], + nodeConfig: { + nodeName: '发起人', + type: 0, + priorityLevel: '', + settype: '', + selectMode: '', + selectRange: '', + directorLevel: '', + examineMode: '', + noHanderAction: '', + examineEndDirectorLevel: '', + ccSelfSelectFlag: '', + conditionList: [], + nodeUserList: [], + conditionNodes: [], + }, + } + } + processConfig.value = data + const { + nodeConfig: nodes, + flowPermission: flows, + directorMaxLevel: directors, + workFlowDef: works, + tableId, + } = data + nodeConfig.value = nodes + flowPermission.value = flows + // directorMaxLevel.value = directors + directorMaxLevel.value = max + workFlowDef.value = works + workFlowStore.setTableId(tableId) }) }) const toReturn = () => { @@ -100,13 +131,24 @@ } } const saveSet = async () => { - processConfig.value.formId = props.getRowData.formId - processConfig.value.formName = props.getRowData.formName - processConfig.value.formDesc = props.getRowData.formDesc - processConfig.value.formContent = props.getRowData.formDesc - processConfig.value.workFlowDef.flowKey = props.getRowData.flowKey - processConfig.value.workFlowDef.directorId = props.getRowData.directorId - processConfig.value.workFlowDef.name = props.getRowData.name + if (!props.isAddProcess) { + processConfig.value.formId = props.getRowData.formId + processConfig.value.formName = props.getRowData.formName + processConfig.value.formDesc = props.getRowData.formDesc + processConfig.value.formContent = props.getRowData.formDesc + processConfig.value.workFlowDef.flowKey = props.getRowData.flowKey + processConfig.value.workFlowDef.directorId = props.getRowData.directorId + processConfig.value.workFlowDef.name = props.getRowData.name + } + else { + processConfig.value.formId = props.getRowData.formID + processConfig.value.formName = props.getRowData.business + processConfig.value.formDesc = props.getRowData.desc + processConfig.value.formContent = props.getRowData.desc + processConfig.value.workFlowDef.directorId = user.id + processConfig.value.workFlowDef.name = props.getRowData.name + } + workFlowStore.setIsTried(true) tipList.value = [] reErr(nodeConfig.value) @@ -115,11 +157,25 @@ tipVisible.value = true return } - processConfig.value.flowPermission = flowPermission.value - const res = await efitProcess(processConfig.value) - if (res.code == 200) { - ElMessage.success('保存成功') + if (!props.isAddProcess) { + // processConfig.value.flowPermission = flowPermission.value //编辑时不允许改发起人 + const res = await editProcess(processConfig.value) + if (res.code == 200) { + ElMessage.success('编辑流程成功') + } + } + else { + processConfig.value.flowPermission = { // 新建时发起人是此时的用户 + name: user.name, // 用户名 + targetId: user.id, // 用户id + type: 1, // 成员 + } + + const res = await addProcess(processConfig.value) + if (res.code == 200) { + ElMessage.success('创建流程成功') + } } } defineExpose({ diff --git a/src/views/system/process/addProcess.vue b/src/views/system/process/addProcess.vue new file mode 100644 index 0000000..f840c40 --- /dev/null +++ b/src/views/system/process/addProcess.vue @@ -0,0 +1,258 @@ + + + + + + diff --git a/src/views/system/process/detailProcess.vue b/src/views/system/process/detailProcess.vue index e1daeca..9fedcbb 100644 --- a/src/views/system/process/detailProcess.vue +++ b/src/views/system/process/detailProcess.vue @@ -11,11 +11,12 @@ const $route = useRoute() const selectFormId = ref('') const ruleFormRef = ref() +const getRowData = ref({}) as any const form: Ref = ref({ - number: '11111', // 编号 - name: '111', // 名称 - business: 'sss', // 关联业务 - desc: '2', // 流程描述 + number: '', // 编号 + name: '', // 名称 + business: '', // 关联业务 + desc: '', // 流程描述 selectDecision: '同意 驳回 拒绝', // 选择的决策 rejectTo: '2', // 可驳回至 changeData: '2', // 驳回修改数据 @@ -73,10 +74,12 @@ onMounted(() => { const rowData: any = $route.query.rowData - // console.log('111111', JSON.parse(rowData)) - const data = JSON.parse(rowData) - selectFormId.value = data.formId - console.log('selectFormId', selectFormId.value) + getRowData.value = JSON.parse(rowData) + selectFormId.value = getRowData.value.formId + form.value.number = getRowData.value.number + form.value.name = getRowData.value.name + form.value.business = getRowData.value.business + form.value.desc = getRowData.value.describe }) @@ -92,9 +95,10 @@ - {{ form.number }} + + - + - + - {{ form.name }} + + + - + + - {{ form.business }} + + + - + diff --git a/src/views/system/process/editProcess.vue b/src/views/system/process/editProcess.vue index ec793e0..330dda1 100644 --- a/src/views/system/process/editProcess.vue +++ b/src/views/system/process/editProcess.vue @@ -11,7 +11,7 @@ const processSetting = ref() const selectFormId = ref('') // formid const $route = useRoute() -const getRowData = ref({}) +const getRowData = ref({}) as any const ruleFormRef = ref() const form: Ref = ref({ number: '', // 编号 @@ -133,7 +133,6 @@ onMounted(() => { const rowData: any = $route.query.rowData - console.log('111111', JSON.parse(rowData)) getRowData.value = JSON.parse(rowData) selectFormId.value = getRowData.value.formId form.value.number = getRowData.value.number @@ -159,9 +158,10 @@ - {{ form.number }} + + - + - + + - {{ form.name }} + - + + - {{ form.business }} + + - + diff --git a/src/views/system/process/process.ts b/src/views/system/process/process.ts index 033977f..4c3671d 100644 --- a/src/views/system/process/process.ts +++ b/src/views/system/process/process.ts @@ -33,9 +33,16 @@ name: string // 名称 business: string // 关联业务 desc?: string // 流程描述 + formID?: string selectDecision: string // 选择的决策 rejectTo?: string // 可驳回至 changeData?: string // 驳回修改数据 isMessage: string // 审批结果通知发起人 } +// 关联业务列表 +export interface IBusinessList { + formId: string + formName: string +} + diff --git a/src/api/system/process.ts b/src/api/system/process.ts index f1f5e7b..e459424 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -49,7 +49,7 @@ } // 流程定义编辑 -export function efitProcess(params: Object) { +export function editProcess(params: Object) { const param = { _value: params, } @@ -60,6 +60,18 @@ }) } +// 新建流程 +export function addProcess(params: Object) { + const param = { + _value: params, + } + return request({ + url: `${prefix}/jsonToBpmn`, + method: 'post', + data: param, + }) +} + // 获取流程定义详情 export function getProcessDetail(formId: string) { const param = { @@ -100,7 +112,7 @@ beginTime: string endTime: string status: string - ids: string[] + // ids: string[] }) { return request({ url: `${prefix}/listExport`, diff --git a/src/components/dialog/selectEmployeesDialog.vue b/src/components/dialog/selectEmployeesDialog.vue index dc67b48..6db84db 100644 --- a/src/components/dialog/selectEmployeesDialog.vue +++ b/src/components/dialog/selectEmployeesDialog.vue @@ -76,7 +76,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map(item => ({ ...item, - type: 2, // type是啥 + type: 1, // type: 1.成员 2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/dialog/selectRoleDialog.vue b/src/components/dialog/selectRoleDialog.vue index 38881f4..64f51ae 100644 --- a/src/components/dialog/selectRoleDialog.vue +++ b/src/components/dialog/selectRoleDialog.vue @@ -71,7 +71,7 @@ const saveDialog = () => { const checkedList = multipleTable.value.map((item: any) => ({ ...item, - type: 2, // type是啥 + type: 2, // type:1.成员,2.角色 // targetId: item.roleId, // name: item.roleName, targetId: item.id, diff --git a/src/components/drawer/approverDrawer.vue b/src/components/drawer/approverDrawer.vue index 0f8a37d..7f5cd2f 100644 --- a/src/components/drawer/approverDrawer.vue +++ b/src/components/drawer/approverDrawer.vue @@ -148,9 +148,6 @@ return } - // if (approverConfig.value.settype === 11) { - // approverConfig.value.settype = 1 - // } // 把审批设置反应在流程图里面 approverConfig.value.error = !$func.setApproverStr(approverConfig.value) // 保存设置 diff --git a/src/components/workFlow/nodeWrap.vue b/src/components/workFlow/nodeWrap.vue index a97f752..90bc3ad 100644 --- a/src/components/workFlow/nodeWrap.vue +++ b/src/components/workFlow/nodeWrap.vue @@ -28,14 +28,15 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { - return userStore.name - // return $func.arrToStr(props.flowPermission) || '所有人' + if (props.nodeConfig.type == 0) { // 发起人 + // return userStore.name + // return $func.arrToStr(props.flowPermission) || userStore.name + return props.flowPermission.name || userStore.name } - if (props.nodeConfig.type == 1) { + if (props.nodeConfig.type == 1) { // 审批 return $func.setApproverStr(props.nodeConfig) } - return $func.copyerStr(props.nodeConfig) + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/components/workFlow/nodeWrapBan.vue b/src/components/workFlow/nodeWrapBan.vue index 2de6650..457d9ab 100644 --- a/src/components/workFlow/nodeWrapBan.vue +++ b/src/components/workFlow/nodeWrapBan.vue @@ -25,11 +25,16 @@ }) const showText = computed(() => { console.log('showText') - if (props.nodeConfig.type == 0) { return $func.arrToStr(props.flowPermission) || '所有人' } - if (props.nodeConfig.type == 1) { - return $func.setApproverStr(props.nodeConfig) + if (props.nodeConfig.type == 0) { + console.log('pppppppp') + console.log(props.flowPermission) + // return $func.arrToStr(props.flowPermission) || '所有人' + return props.flowPermission.name || userStore.name } - return $func.copyerStr(props.nodeConfig) + if (props.nodeConfig.type == 1) { + return $func.setApproverStr(props.nodeConfig) // 审批 + } + return $func.copyerStr(props.nodeConfig) // 抄送 }) watch(() => props.nodeConfig, (val) => { console.log('watch nodeConfig') diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index edac0e5..6f516aa 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -202,6 +202,18 @@ activeMenu: '/process/list', }, }, + { + path: 'add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, ], }, { diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index e133fdb..5758df9 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -89,11 +89,20 @@ label: '逾期未检定', value: 'yqwjd', }, -] +]// 检定结果 +const mesureResultMap = { + hg: '合格', + xhhg: '修后合格', + xy: '限用', + zy: '准用', + bhg: '不合格', + lj: '漏检', + yqwjd: '逾期未检定', +}// 检定结果字典 const mesureTypeList = [ { - label: '外检', - value: 'wj', + label: '自检', + value: 'zj', }, { label: '外包', @@ -337,30 +346,32 @@ const getInfo = () => { getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'wj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // } + // res.data = { + // ABC: 'A', + // companyAddress: '北京/北京市', + // customerName: '京东集团', + // customerNo: 'sygf202211290001', + // id: '', + // labelBind: '11222', + // manufacturer: '北京某厂家', + // manufacturerCountry: 'CN', + // manufacturingDate: '2023-03', + // manufacturingNo: '123121', + // mesureCategory: 'jd', + // mesureContent: '项目1', + // mesurePeriod: '1', + // mesureType: 'zj', + // minioFileName: '小程序工期表-1117_1674961769128.xlsx', + // phone: '950618', + // postalCode: 'test', + // remark: '无备注', + // sampleModel: '型号1', + // sampleName: '样品1', + // sampleNo: '', + // measureResultCode: 'bhg', + // } dataForm.value = res.data + dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] for (const item of menu) { item.searchFunc() } @@ -599,7 +610,13 @@ - + - + - + diff --git a/src/views/customer/sample/list/list.vue b/src/views/customer/sample/list/list.vue index 3d46b46..08dc008 100644 --- a/src/views/customer/sample/list/list.vue +++ b/src/views/customer/sample/list/list.vue @@ -47,33 +47,46 @@ const fileRef = ref() // 数据查询 function fetchData(isNowPage = false) { - loadingTable.value = true + // loadingTable.value = true if (!isNowPage) { // 是否显示当前页,否则跳转第一页 listQuery.value.offset = 1 } listQuery.value.startTime = timeRange.value[0] as string || '' listQuery.value.endTime = timeRange.value[1] as string || '' - getSampleList(listQuery.value).then((response) => { - // 模拟数据 + // getSampleList(listQuery.value).then((response) => { + // 模拟数据 - // response.data.rows = [ - // { - // id: '1597579843411234817', - // sampleNo: '1', // 样品编号 - // sampleName: '1', // 样品名称 - // sampleModel: '1', // 型号 - // evaluationName: '1', // 出厂编号 - // customerId: '1', // 委托方代码 - // customerName: '1', // 委托方名称 - // mesurePeriod: '1', // 检定周期 - // effectiveDate: '1', // 上次检定时间 - // remark: '备注', // 备注 - // }] - list.value = response.data.rows - total.value = parseInt(response.data.total) - loadingTable.value = false - }) + // response.data.rows = [ + // { + // id: '1597579843411234817', + // sampleNo: '1', // 样品编号 + // sampleName: '1', // 样品名称 + // sampleModel: '1', // 型号 + // evaluationName: '1', // 出厂编号 + // customerId: '1', // 委托方代码 + // customerName: '1', // 委托方名称 + // mesurePeriod: '1', // 检定周期 + // effectiveDate: '1', // 上次检定时间 + // remark: '备注', // 备注 + // }] + // list.value = response.data.rows + // total.value = parseInt(response.data.total) + // loadingTable.value = false + // }) + list.value = [ + { + id: '1597579843411234817', + sampleNo: '1', // 样品编号 + sampleName: '1', // 样品名称 + sampleModel: '1', // 型号 + evaluationName: '1', // 出厂编号 + customerId: '1', // 委托方代码 + customerName: '1', // 委托方名称 + mesurePeriod: '1', // 检定周期 + effectiveDate: '1', // 上次检定时间 + remark: '备注', // 备注 + }] } // 多选发生改变时 function handleSelectionChange(e: any) { diff --git a/src/views/customer/sample/list/sample_list_interface.ts b/src/views/customer/sample/list/sample_list_interface.ts index f8c4555..f5d0514 100644 --- a/src/views/customer/sample/list/sample_list_interface.ts +++ b/src/views/customer/sample/list/sample_list_interface.ts @@ -47,6 +47,10 @@ minioFileName: string // 说明书 labelBind: string // 标签绑定 mesureType: string // 检定方式 + measureDate?: string // 检定日期 + effectiveDate?: string // 有效日期 + measureResultCode?: string // 检定结果代码 + measureResult?: string // 检定结果 } // 检定记录 diff --git a/src/views/setting.vue b/src/views/setting.vue index c03a0bf..fb59203 100644 --- a/src/views/setting.vue +++ b/src/views/setting.vue @@ -8,7 +8,7 @@ import approverDrawer from '@/components/drawer/approverDrawer.vue' import copyerDrawer from '@/components/drawer/copyerDrawer.vue' import conditionDrawer from '@/components/drawer/conditionDrawer.vue' -import { efitProcess, getDirectorLevel, getProcessDetail, unloadProcess } from '@/api/system/process' +import { addProcess, editProcess, getDirectorLevel, getProcessDetail, unloadProcess } from '@/api/system/process' import userStore from '@/store/modules/user' const props = defineProps({ allowEditNode: { @@ -20,6 +20,10 @@ default: () => {}, }, selectFormId: String, + isAddProcess: { + type: Boolean, + default: false, + }, }) const user = userStore() @@ -38,31 +42,58 @@ return res.data } onMounted(async () => { - const res = await getDirectorLevel('1615620539758731266') - console.log('=====', res, user.id) - let max - // const res = await getDirectorLevel(user.id) - if (res.code === 200) { + let max = 0 // 审批主管最大层级 + + // 获取此用户的审批主管的最大层级 + getDirectorLevel(user.id).then((res) => { max = res.data.level - } + }) const route = useRoute() - nextTick(() => { - initDetail(props.selectFormId).then((data) => { - processConfig.value = data - const { - nodeConfig: nodes, - flowPermission: flows, - directorMaxLevel: directors, - workFlowDef: works, - tableId, - } = data - nodeConfig.value = nodes - flowPermission.value = flows - // directorMaxLevel.value = directors - directorMaxLevel.value = max - workFlowDef.value = works - workFlowStore.setTableId(tableId) - }) + nextTick(async () => { + let data + if (!props.isAddProcess) { // 非新建流程--调流程详情接口 + data = await initDetail(props.selectFormId) + } + else { // 新建流程 + data = { + tableId: 1, + workFlowDef: { + name: '合同审批', + }, + directorMaxLevel: max, + flowPermission: [], + nodeConfig: { + nodeName: '发起人', + type: 0, + priorityLevel: '', + settype: '', + selectMode: '', + selectRange: '', + directorLevel: '', + examineMode: '', + noHanderAction: '', + examineEndDirectorLevel: '', + ccSelfSelectFlag: '', + conditionList: [], + nodeUserList: [], + conditionNodes: [], + }, + } + } + processConfig.value = data + const { + nodeConfig: nodes, + flowPermission: flows, + directorMaxLevel: directors, + workFlowDef: works, + tableId, + } = data + nodeConfig.value = nodes + flowPermission.value = flows + // directorMaxLevel.value = directors + directorMaxLevel.value = max + workFlowDef.value = works + workFlowStore.setTableId(tableId) }) }) const toReturn = () => { @@ -100,13 +131,24 @@ } } const saveSet = async () => { - processConfig.value.formId = props.getRowData.formId - processConfig.value.formName = props.getRowData.formName - processConfig.value.formDesc = props.getRowData.formDesc - processConfig.value.formContent = props.getRowData.formDesc - processConfig.value.workFlowDef.flowKey = props.getRowData.flowKey - processConfig.value.workFlowDef.directorId = props.getRowData.directorId - processConfig.value.workFlowDef.name = props.getRowData.name + if (!props.isAddProcess) { + processConfig.value.formId = props.getRowData.formId + processConfig.value.formName = props.getRowData.formName + processConfig.value.formDesc = props.getRowData.formDesc + processConfig.value.formContent = props.getRowData.formDesc + processConfig.value.workFlowDef.flowKey = props.getRowData.flowKey + processConfig.value.workFlowDef.directorId = props.getRowData.directorId + processConfig.value.workFlowDef.name = props.getRowData.name + } + else { + processConfig.value.formId = props.getRowData.formID + processConfig.value.formName = props.getRowData.business + processConfig.value.formDesc = props.getRowData.desc + processConfig.value.formContent = props.getRowData.desc + processConfig.value.workFlowDef.directorId = user.id + processConfig.value.workFlowDef.name = props.getRowData.name + } + workFlowStore.setIsTried(true) tipList.value = [] reErr(nodeConfig.value) @@ -115,11 +157,25 @@ tipVisible.value = true return } - processConfig.value.flowPermission = flowPermission.value - const res = await efitProcess(processConfig.value) - if (res.code == 200) { - ElMessage.success('保存成功') + if (!props.isAddProcess) { + // processConfig.value.flowPermission = flowPermission.value //编辑时不允许改发起人 + const res = await editProcess(processConfig.value) + if (res.code == 200) { + ElMessage.success('编辑流程成功') + } + } + else { + processConfig.value.flowPermission = { // 新建时发起人是此时的用户 + name: user.name, // 用户名 + targetId: user.id, // 用户id + type: 1, // 成员 + } + + const res = await addProcess(processConfig.value) + if (res.code == 200) { + ElMessage.success('创建流程成功') + } } } defineExpose({ diff --git a/src/views/system/process/addProcess.vue b/src/views/system/process/addProcess.vue new file mode 100644 index 0000000..f840c40 --- /dev/null +++ b/src/views/system/process/addProcess.vue @@ -0,0 +1,258 @@ + + + + + + diff --git a/src/views/system/process/detailProcess.vue b/src/views/system/process/detailProcess.vue index e1daeca..9fedcbb 100644 --- a/src/views/system/process/detailProcess.vue +++ b/src/views/system/process/detailProcess.vue @@ -11,11 +11,12 @@ const $route = useRoute() const selectFormId = ref('') const ruleFormRef = ref() +const getRowData = ref({}) as any const form: Ref = ref({ - number: '11111', // 编号 - name: '111', // 名称 - business: 'sss', // 关联业务 - desc: '2', // 流程描述 + number: '', // 编号 + name: '', // 名称 + business: '', // 关联业务 + desc: '', // 流程描述 selectDecision: '同意 驳回 拒绝', // 选择的决策 rejectTo: '2', // 可驳回至 changeData: '2', // 驳回修改数据 @@ -73,10 +74,12 @@ onMounted(() => { const rowData: any = $route.query.rowData - // console.log('111111', JSON.parse(rowData)) - const data = JSON.parse(rowData) - selectFormId.value = data.formId - console.log('selectFormId', selectFormId.value) + getRowData.value = JSON.parse(rowData) + selectFormId.value = getRowData.value.formId + form.value.number = getRowData.value.number + form.value.name = getRowData.value.name + form.value.business = getRowData.value.business + form.value.desc = getRowData.value.describe }) @@ -92,9 +95,10 @@ - {{ form.number }} + + - + - + - {{ form.name }} + + + - + + - {{ form.business }} + + + - + diff --git a/src/views/system/process/editProcess.vue b/src/views/system/process/editProcess.vue index ec793e0..330dda1 100644 --- a/src/views/system/process/editProcess.vue +++ b/src/views/system/process/editProcess.vue @@ -11,7 +11,7 @@ const processSetting = ref() const selectFormId = ref('') // formid const $route = useRoute() -const getRowData = ref({}) +const getRowData = ref({}) as any const ruleFormRef = ref() const form: Ref = ref({ number: '', // 编号 @@ -133,7 +133,6 @@ onMounted(() => { const rowData: any = $route.query.rowData - console.log('111111', JSON.parse(rowData)) getRowData.value = JSON.parse(rowData) selectFormId.value = getRowData.value.formId form.value.number = getRowData.value.number @@ -159,9 +158,10 @@ - {{ form.number }} + + - + - + + - {{ form.name }} + - + + - {{ form.business }} + + - + diff --git a/src/views/system/process/process.ts b/src/views/system/process/process.ts index 033977f..4c3671d 100644 --- a/src/views/system/process/process.ts +++ b/src/views/system/process/process.ts @@ -33,9 +33,16 @@ name: string // 名称 business: string // 关联业务 desc?: string // 流程描述 + formID?: string selectDecision: string // 选择的决策 rejectTo?: string // 可驳回至 changeData?: string // 驳回修改数据 isMessage: string // 审批结果通知发起人 } +// 关联业务列表 +export interface IBusinessList { + formId: string + formName: string +} + diff --git a/src/views/system/process/process.vue b/src/views/system/process/process.vue index 1be7c1d..a66f871 100644 --- a/src/views/system/process/process.vue +++ b/src/views/system/process/process.vue @@ -4,7 +4,7 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import { Delete } from '@element-plus/icons-vue' import { useRoute, useRouter } from 'vue-router' -import type { IlistQuery } from './process' +import type { IBusinessList, IlistQuery } from './process' import EditProcess from './editProcess.vue' import DetailProcess from './detailProcess.vue' import { delProcessList, exportProcessList, getBusinessList, getProcessList, updateState } from '@/api/system/process' @@ -14,7 +14,7 @@ const { proxy } = getCurrentInstance() as any const active = ref('main') -const businessList = ref([]) // 关联业务列表 +const businessList = ref([]) // 关联业务列表 const listQuery = reactive({ deploymentId: '', // 流程部署id suspensionState: '', // 状态流程 1激活 2废止 @@ -38,23 +38,6 @@ label: '废止', }, ] -const businessDic = { - FILE_APPROVAL: 'jlglwjsp', // 文件审批, - TRAIN_APPROVAL: 'jlglpxjhsp', // 培训计划审批 - SUPPLIER_APPROVAL: 'jlglsygfsp', // 溯源供方审批 - STANDARD_CHANGE_APPROVAL: 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL: 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL: 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL: 'sbglbzzzghsq', // 标准装置恢复申请 - STANDARD_CHECK_APPROVAL: 'sbglbzzzfcsq', // 标准装置复查申请 - DEVICE_UNUSED_APPROVAL: 'sbglsbxzsq', // 设备闲置申请 - DEVICE_SEALED_APPROVAL: 'sbglsbfcsq', // 设备封存申请 - DEVICE_UNSEALED_APPROVAL: 'sbglsbqfsq', // 设备启封申请 - DEVICE_SCRAPPED_ROVAL: 'sbglsbbfsq', // 设备报废申请 - DEVICE_HANDLE_APPROVAL: 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL: 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL: 'sbglsbjysq', // 设备借用申请 -} const columns = ref([ { text: '流程编号', @@ -166,6 +149,9 @@ const handleEdit = (row: IlistQuery, pageType: 'edit' | 'detail') => { $router.push({ path: `/process/${pageType}`, query: { rowData: JSON.stringify(row) } }) } +const add = () => { + $router.push({ path: '/process/add' }) +} // 废止 const abolish = (row: IlistQuery) => { const state = row.status === '激活' ? 2 : 1 @@ -208,7 +194,7 @@ beginTime: '', // 开始时间 endTime: '', // 结束时间 status: '', // 当前流程状态, - ids: checkoutList.value, + // ids: checkoutList.value, } exportProcessList(params).then((res) => { const blob = new Blob([res.data]) @@ -286,7 +272,7 @@ placeholder="关联业务" clearable /> --> - +