From 35e4de39fa64fe95a0f0a37fc746e639747c2771 Mon Sep 17 00:00:00 2001
From: z9130 <984661593@qq.com>
Date: Fri, 11 Oct 2024 12:22:43 +0800
Subject: [PATCH] =?UTF-8?q?=E7=AB=8B=E9=A1=B9=E5=BA=9F=E9=99=A4=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=EF=BC=9B=E9=80=89=E5=95=86=E6=A0=87=E6=AE=B5=E4=BF=A1?=
=?UTF-8?q?=E6=81=AF=E5=92=8C=E4=BE=9B=E5=BA=94=E5=95=86=E4=BF=A1=E6=81=AF?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AF=B9=E6=8E=A5=E5=AE=8C=E5=96=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apps/web-contract/src/utils/dict/shared.ts | 2 +
.../src/utils/dict/static.data.js | 8 +
.../views/contract/approval/edit/index.vue | 184 +++++++++-
.../contract/business/edit/bid-columns.tsx | 35 +-
.../src/views/contract/business/edit/curd.tsx | 23 +-
.../views/contract/business/edit/index.vue | 318 ++++++++++++++++--
.../components/todo-page/todo-page.vue | 23 +-
.../web-contract/src/views/contract/schema.ts | 16 +-
apps/web-contract/vite.config.mts | 26 +-
9 files changed, 524 insertions(+), 111 deletions(-)
diff --git a/apps/web-contract/src/utils/dict/shared.ts b/apps/web-contract/src/utils/dict/shared.ts
index 6c4256b8..e759b25b 100644
--- a/apps/web-contract/src/utils/dict/shared.ts
+++ b/apps/web-contract/src/utils/dict/shared.ts
@@ -48,6 +48,8 @@ export enum DICT_TYPE {
payment_nature = 'payment_nature',
/** 合同立项节点流程 */
contract_approval_flow_node = 'contract_approval_flow_node',
+ /** 合同选商节点流程 */
+ contract_business_flow_node = 'contract_business_flow_node',
/** 合同立项节点流程 */
contract_abolish_flow_node = 'contract_abolish_flow_node',
/** 合同授权类型 */
diff --git a/apps/web-contract/src/utils/dict/static.data.js b/apps/web-contract/src/utils/dict/static.data.js
index f726742c..90825cd0 100644
--- a/apps/web-contract/src/utils/dict/static.data.js
+++ b/apps/web-contract/src/utils/dict/static.data.js
@@ -77,6 +77,14 @@ export default {
{ label: '待废除审批', value: 'abolishDepartmentAudit' },
]),
+ contract_business_flow_node: createEntry('合同选商节点流程', [
+ { label: '待提交', value: 'edit' },
+ { label: '待部门审核', value: 'departmentAudit' },
+ { label: '已结束', value: 'end' },
+ { label: '废除发起', value: 'abolishEdit' },
+ { label: '待废除审批', value: 'abolishDepartmentAudit' },
+ ]),
+
contract_abolish_flow_node: createEntry('合同立项节点流程', [
{ label: '待提交', value: 'edit' },
{ label: '待部门审核', value: 'departmentAudit' },
diff --git a/apps/web-contract/src/views/contract/approval/edit/index.vue b/apps/web-contract/src/views/contract/approval/edit/index.vue
index 4e7bcd67..1e70cd8a 100644
--- a/apps/web-contract/src/views/contract/approval/edit/index.vue
+++ b/apps/web-contract/src/views/contract/approval/edit/index.vue
@@ -149,19 +149,129 @@ function removeRow(row) {
}
}
-function handleAbolish() {
- Modal.confirm({
- title: '提示',
- content: '是否确认作废该合同?确认后该合同无法再次使用',
- okType: 'danger',
- onOk: async () => {
- // await Apis.contractBaseInfo.post_abolish({
- // data: {
- // guid: currData.value['guid'],
- // },
- // });
- },
- });
+const userModalOpenType = ref<'abolish' | 'audit'>('audit');
+const currAuditType = ref<'abolish' | 'audit'>('audit');
+
+const userListByAbolish = ref([]);
+
+async function handleAbolish(type: 'openModal' | 'confirm') {
+ userModalOpenType.value = 'abolish';
+ if (type === 'openModal') {
+ Modal.confirm({
+ title: '提示',
+ content: '是否确认作废该合同?确认后该合同无法再次使用',
+ okType: 'danger',
+ onOk: async () => {
+ chooseUserModalApi.setData({
+ title: '选择立项废除审批人',
+ userIds: [],
+ });
+ chooseUserModalApi.open();
+ },
+ });
+ }
+ if (type === 'confirm') {
+ const hideLoading = message.loading('提交中...', 0);
+ try {
+ await Apis.contractBaseInfo.post_abolishFlowStart({
+ data: {
+ guid: currData.value['guid'],
+ assigneeList: userListByAbolish.value.map((item) => item.ACCOUNT_ID),
+ },
+ });
+ } catch (error) {
+ logger.error('立项废除提交失败', error);
+ } finally {
+ hideLoading();
+ }
+ }
+}
+
+async function handleAbolishAudit(
+ type: 'accessConfirm' | 'reject' | 'rejectConfirm',
+ data?: any,
+) {
+ console.log(type);
+
+ if (type === 'accessConfirm') {
+ Modal.confirm({
+ title: '提示',
+ content: '是否确认立项废除审核通过?',
+ onOk: async () => {
+ try {
+ await Apis.contractBaseInfo.post_abolishSubmit({
+ params: {
+ guid: id.value,
+ },
+ data: {
+ // appId: id.value,
+ taskId: currData.value.taskId,
+ nodeId: '',
+ comment: '通过',
+ },
+ });
+ message.success('审核通过');
+ back();
+ } catch (error) {
+ logger.error('审核通过失败', error);
+ message.error('审核通过失败,请稍候再试');
+ }
+ },
+ });
+ }
+
+ if (type === 'reject') {
+ Modal.confirm({
+ title: '提示',
+ content: '是否确认拒绝废除该立项?',
+ onOk: () => {
+ temporaryFormModalApi.setData({
+ title: '退回原因',
+ schema: {
+ columns: {
+ comment: {
+ title: '',
+ key: 'comment',
+ col: { span: 24 },
+ colon: false,
+ component: {
+ name: 'a-textarea',
+ vModel: 'value',
+ autoSize: { minRows: 4, maxRows: 6 },
+ placeholder: '请输入',
+ },
+ rules: [{ required: true, message: '请输入退回原因' }],
+ },
+ },
+ },
+ });
+ temporaryFormModalApi.open();
+ },
+ });
+ }
+
+ if (type === 'rejectConfirm') {
+ const comment = data.comment;
+ try {
+ await Apis.contractBaseInfo.post_rollback({
+ params: {
+ guid: id.value,
+ },
+ data: {
+ appId: id.value,
+ taskId: currData.value.taskId,
+ nodeId: '',
+ comment,
+ },
+ });
+ temporaryFormModalApi.close();
+ message.success('退回成功');
+ back();
+ } catch (error) {
+ logger.error('合同立项退回失败', error);
+ message.error('退回失败,请稍候再试');
+ }
+ }
}
function handleDelete() {
@@ -195,6 +305,11 @@ function handleChooseConfirm(rows) {
async function handleChooseUserConfirm(e) {
chooseUserModalApi.close();
isLoading.value = true;
+ if (userModalOpenType.value === 'abolish') {
+ userListByAbolish.value = e;
+ handleAbolish('confirm');
+ return;
+ }
try {
await Apis.contractBaseInfo.post_applyFlowStart({
data: {
@@ -302,9 +417,11 @@ async function handleSave() {
}
async function handleSubmit() {
+ userModalOpenType.value = 'audit';
// isLoading.value = true
chooseUserModalApi.setData({
title: '选择审批人',
+ userIds: [],
});
chooseUserModalApi.open();
}
@@ -316,6 +433,10 @@ async function handleAudit(
console.log(type);
if (type === 'accessConfirm') {
+ if (currAuditType.value === 'abolish') {
+ await handleAbolish('confirm');
+ return;
+ }
Modal.confirm({
title: '提示',
content: '是否确认审核通过?',
@@ -535,7 +656,7 @@ onMounted(async () => {
currData.inputUserId === userInfo!.userId
"
variant="destructive"
- @click="handleAbolish()"
+ @click="handleAbolish('openModal')"
>
废除
@@ -546,6 +667,41 @@ onMounted(async () => {
>
删除
+
+
+ 废除通过
+
+
+
+ 废除拒绝
+
+
+
+ 通过
+
返回
diff --git a/apps/web-contract/src/views/contract/business/edit/bid-columns.tsx b/apps/web-contract/src/views/contract/business/edit/bid-columns.tsx
index 7ff8403d..fdaa384b 100644
--- a/apps/web-contract/src/views/contract/business/edit/bid-columns.tsx
+++ b/apps/web-contract/src/views/contract/business/edit/bid-columns.tsx
@@ -2,16 +2,10 @@ import type { VxeGridPropTypes } from 'vxe-table';
export function getBidColumns(_params?: any): VxeGridPropTypes.Columns {
const columns: VxeGridPropTypes.Columns = [
- {
- field: 'operate',
- title: '操作',
- width: 120,
- slots: { default: 'operate-slot' },
- },
- {
- type: 'seq',
- width: 50,
- },
+ // {
+ // type: 'seq',
+ // width: 50,
+ // },
{
type: 'expand',
width: '0px',
@@ -35,6 +29,13 @@ export function getBidColumns(_params?: any): VxeGridPropTypes.Columns {
minWidth: 300,
slots: { default: 'phasedesc-slot' },
},
+ {
+ field: 'operate',
+ title: '操作',
+ width: 120,
+ fixed: 'right',
+ slots: { default: 'operate-slot' },
+ },
];
return columns;
@@ -42,12 +43,6 @@ export function getBidColumns(_params?: any): VxeGridPropTypes.Columns {
export function getProviderColumns(_params?: any): VxeGridPropTypes.Columns {
const columns: VxeGridPropTypes.Columns = [
- {
- field: 'operate',
- title: '操作',
- width: 120,
- slots: { default: 'operate-slot' },
- },
{
field: 'providerName',
title: '供应商名称',
@@ -77,7 +72,13 @@ export function getProviderColumns(_params?: any): VxeGridPropTypes.Columns {
minWidth: 200,
slots: { default: 'remarks-slot' },
},
-
+ {
+ field: 'operate',
+ title: '操作',
+ width: 120,
+ fixed: 'right',
+ slots: { default: 'operate-slot' },
+ },
];
return columns;
diff --git a/apps/web-contract/src/views/contract/business/edit/curd.tsx b/apps/web-contract/src/views/contract/business/edit/curd.tsx
index b7f7f2b8..40d8c2ff 100644
--- a/apps/web-contract/src/views/contract/business/edit/curd.tsx
+++ b/apps/web-contract/src/views/contract/business/edit/curd.tsx
@@ -17,27 +17,6 @@ const [ChooseCompanyModal, chooseCompanyModalApi] = useVbenModal({
const xGridRefs = ref