From 68432d4d68341c070ad559937205286f128db5e4 Mon Sep 17 00:00:00 2001
From: z9130 <984661593@qq.com>
Date: Sat, 28 Sep 2024 19:47:43 +0800
Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=90=8C=E7=9B=B8=E5=85=B3=E5=AE=8C?=
=?UTF-8?q?=E5=96=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apps/web-contract/src/app.vue | 50 ++-
.../temporary-form-modal.vue | 55 +++
apps/web-contract/src/layouts/basic.vue | 2 -
.../src/router/routes/modules/contract.ts | 1 +
apps/web-contract/src/store/dict.ts | 3 +
apps/web-contract/src/utils/dict/index.ts | 48 ++-
.../src/views/contract/approval/edit/curd.tsx | 171 +-------
.../views/contract/approval/edit/index.vue | 153 ++++++-
.../src/views/contract/approval/list/crud.tsx | 30 +-
.../business/edit/basic-info-curd.tsx | 20 +-
.../views/contract/business/list/index.vue | 2 +-
.../company/list/choose-company-modal.vue | 20 +-
.../components/todo-page/todo-page.vue | 7 +-
.../views/contract/declaration/edit/curd.tsx | 151 ++++---
.../views/contract/declaration/edit/index.vue | 240 +++++------
.../views/contract/declaration/list/index.vue | 65 ++-
.../contract/declaration/print/index.vue | 71 +---
.../src/views/contract/perform/list/index.vue | 117 +----
.../web-contract/src/views/contract/schema.ts | 2 +-
.../contract/sign-authorization/edit/curd.tsx | 16 +-
.../src/views/contract/sign/edit/curd.tsx | 401 +++++-------------
.../src/views/contract/sign/edit/index.vue | 11 +-
.../src/views/contract/sign/list/crud.tsx | 5 +-
.../src/views/contract/sign/list/index.vue | 2 +-
.../src/views/contract/sign/todo/index.vue | 185 +-------
apps/web-contract/src/views/contract/utils.ts | 84 +++-
.../src/views/user-center/todo/index.vue | 17 +-
apps/web-office/src/app.vue | 31 +-
apps/web-office/src/layouts/basic.vue | 59 ++-
apps/web-office/src/store/index.ts | 2 +-
apps/web-office/src/utils/dict/index.ts | 49 ++-
.../src/views/duty/list/duty-edit-modal.vue | 182 ++++----
32 files changed, 1015 insertions(+), 1237 deletions(-)
create mode 100644 apps/web-contract/src/components/temporary-form-modal/temporary-form-modal.vue
diff --git a/apps/web-contract/src/app.vue b/apps/web-contract/src/app.vue
index f8ca521a..06f7d675 100644
--- a/apps/web-contract/src/app.vue
+++ b/apps/web-contract/src/app.vue
@@ -33,7 +33,7 @@ const tokenTheme = computed(() => {
const dictStore = useDictStore();
if (dictStore.initDict) {
- // dictStore.setDictMap();
+ dictStore.setDictMap();
}
@@ -64,4 +64,52 @@ if (dictStore.initDict) {
.ant-btn__warning {
@apply bg-warning text-warning-foreground hover:bg-warning/90 shadow;
}
+
+.ant-checkbox-disabled .ant-checkbox-inner {
+ background: #fafafa;
+ color: #333;
+}
+
+.ant-input-number-disabled {
+ background: #fafafa;
+ color: #333;
+}
+
+.ant-input-affix-wrapper-disabled,
+.ant-input-affix-wrapper[disabled] {
+ background: #fafafa;
+ color: #333;
+}
+
+.ant-radio-wrapper-disabled {
+ background: #fafafa;
+ color: #333;
+}
+.ant-radio-wrapper .ant-radio-disabled .ant-radio-inner {
+ background-color: rgba(50, 54, 57, 0.04);
+ border-color: hsl(240 5.9% 90%);
+}
+
+.ant-picker.ant-picker-disabled {
+ background: #fafafa;
+ color: #333;
+}
+
+.ant-select-disabled.ant-select:not(.ant-select-customize-input)
+ .ant-select-selector {
+ background: #fafafa;
+ color: #333;
+}
+
+.ant-picker .ant-picker-input > input-disabled,
+.ant-picker .ant-picker-input > input[disabled] {
+ background: #fafafa;
+ color: #333 !important;
+}
+
+.ant-input-disabled,
+.ant-input[disabled] {
+ background: #fafafa;
+ color: #333;
+}
diff --git a/apps/web-contract/src/components/temporary-form-modal/temporary-form-modal.vue b/apps/web-contract/src/components/temporary-form-modal/temporary-form-modal.vue
new file mode 100644
index 00000000..bbf22fbc
--- /dev/null
+++ b/apps/web-contract/src/components/temporary-form-modal/temporary-form-modal.vue
@@ -0,0 +1,55 @@
+
+
+
+
+
+
diff --git a/apps/web-contract/src/layouts/basic.vue b/apps/web-contract/src/layouts/basic.vue
index 69455d94..1ae91be4 100644
--- a/apps/web-contract/src/layouts/basic.vue
+++ b/apps/web-contract/src/layouts/basic.vue
@@ -106,14 +106,12 @@ function handleMakeAll() {
}
function handleViewAll() {
- console.log('viewAll');
router.push('/user/todo');
}
const isDev = import.meta.env.MODE === 'development';
const value = ref(localStorage.getItem('@@@proxy_type') || ''); // /zp
function handleMenuClick(e) {
- console.log(e);
if (e.key === 'pro') {
localStorage.setItem('@@@proxy_type', '');
} else {
diff --git a/apps/web-contract/src/router/routes/modules/contract.ts b/apps/web-contract/src/router/routes/modules/contract.ts
index 1026af72..681464bf 100644
--- a/apps/web-contract/src/router/routes/modules/contract.ts
+++ b/apps/web-contract/src/router/routes/modules/contract.ts
@@ -37,6 +37,7 @@ const routes: RouteRecordRaw[] = [
name: 'ContractApprovalEdit',
path: '/contract/approval/edit/:id?',
beforeEnter: (e) => {
+ console.log('e', e);
if (e.params.id && e.params.id === ':id') {
e.params.id = '';
e.fullPath = '/contract/approval/edit';
diff --git a/apps/web-contract/src/store/dict.ts b/apps/web-contract/src/store/dict.ts
index 674fcb79..a83f8ae9 100644
--- a/apps/web-contract/src/store/dict.ts
+++ b/apps/web-contract/src/store/dict.ts
@@ -38,6 +38,9 @@ export const useDictStore = defineStore('app-dict', () => {
*/
const setDictMap = async (): Promise => {
try {
+ // 模拟网络请求
+ // await new Promise((resolve) => setTimeout(resolve, 2000));
+
const data = await Apis.dictData.get_page({
params: { pageNum: 1, pageSize: 10_000 },
});
diff --git a/apps/web-contract/src/utils/dict/index.ts b/apps/web-contract/src/utils/dict/index.ts
index 05a1f496..695e98a2 100644
--- a/apps/web-contract/src/utils/dict/index.ts
+++ b/apps/web-contract/src/utils/dict/index.ts
@@ -1,4 +1,6 @@
/** 数据字典工具类 */
+import { computed } from 'vue';
+
import Apis from '#/api';
import { useDictStore } from '#/store/dict';
import dataModule from '#/utils/dict/static.data';
@@ -7,6 +9,10 @@ export * from './shared';
const dictStore = useDictStore();
+const dictData = computed(() => {
+ return dictStore.dictMap;
+});
+
/**
* 获取 dictType 对应的数据字典数组
*
@@ -29,7 +35,7 @@ export interface DictDataOptions {
}
export function getDictDatas(dictType: string) {
- return dictStore.getDictMap[dictType] || [];
+ return dictData.value[dictType] || [];
}
export function getDictOpts(dictType: string) {
@@ -58,7 +64,7 @@ export async function getDictDatasAsync(dictTypes: string[]) {
dictDataMap[dictType].push({
...dictData,
value: dictData.value,
- label: dictData.name,
+ label: dictData.label,
colorType: dictData.colorType,
cssClass: dictData.cssClass,
} as DictDataType);
@@ -100,7 +106,7 @@ export function getDictOptions(
const dictOption: DictDataType[] = [];
valueType ||= 'string';
- const dictOptions: DictDataType[] = getDictDatas(dictType);
+ const dictOptions: DictDataType[] = dictData.value[dictType] || [];
if (dictOptions && dictOptions.length > 0) {
dictOptions.forEach((dict: DictDataType) => {
dictOption.push({
@@ -166,6 +172,42 @@ export function getDictObj(dictType: string, value: any): DictDataType | null {
}
}
+/** 获取指定 value 的字典数据 */
+export function getDictObjByOptions(
+ options: DictDataType[],
+ value: any,
+): DictDataType | null {
+ if (options) {
+ if (value) {
+ const result = options.find((dict: DictDataType) => dict.value === value);
+ return result || null;
+ }
+ return null;
+ } else {
+ return null;
+ }
+}
+
+/** 获取指定 value 的字典数据 */
+export async function getDictObjAsync(
+ dictType: string,
+ value: any,
+): Promise {
+ const dictOptions = await getDictOptionsAsync(dictType);
+ if (dictOptions) {
+ if (value) {
+ return (
+ dictOptions.find(
+ (dict: DictDataType) => dict.value === value.toString(),
+ ) || null
+ );
+ }
+ return null;
+ } else {
+ return null;
+ }
+}
+
/** 获取字典默认数据 */
export function getDictDefaultObj(dictType: string): DictDataType | null {
const dictOptions: DictDataType[] = getDictDatas(dictType);
diff --git a/apps/web-contract/src/views/contract/approval/edit/curd.tsx b/apps/web-contract/src/views/contract/approval/edit/curd.tsx
index 8cf7e248..5666433d 100644
--- a/apps/web-contract/src/views/contract/approval/edit/curd.tsx
+++ b/apps/web-contract/src/views/contract/approval/edit/curd.tsx
@@ -1,20 +1,7 @@
import { dict } from '@fast-crud/fast-crud';
import { DICT_TYPE, getDictObj, getDictOptions } from '#/utils/dict';
-
-/**
- * 筛选合同列表数据
- *
- */
-function filterContractTypes(contractTypeData: any = [], parentId: string) {
- return contractTypeData
- .map((item) => {
- item.label = item.contrLevelName;
- item.value = item.contrLevelId;
- return item;
- })
- .filter((item) => item.parentId === parentId);
-}
+import { filterContractTypes } from '#/views/contract/utils';
export function getFormSchema(params: any = {}) {
const { contractTypeData, readOnly = false } = params;
@@ -28,16 +15,9 @@ export function getFormSchema(params: any = {}) {
name: 'a-input',
vModel: 'value',
allowClear: false,
+ disabled: readOnly,
},
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- return {form.contractName};
- },
- },
- rules: [{ required: true }],
+ rules: [{ required: true, message: '请输入合同名称' }],
},
ctrType: {
title: '合同类别',
@@ -53,6 +33,7 @@ export function getFormSchema(params: any = {}) {
return filterContractTypes(contractTypeData, '-1');
},
}),
+ disabled: readOnly,
},
valueChange: {
immediate: true, // 是否立即执行一次
@@ -62,21 +43,7 @@ export function getFormSchema(params: any = {}) {
getComponentRef('ctrTwoType').reloadDict(); // 执行city的select组件的reloadDict()方法,触发“city”重新加载字典
},
},
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- const data = filterContractTypes(contractTypeData, '-1');
- for (const item of data) {
- if (item.value === form.ctrType) {
- return {item.label};
- }
- }
- return ;
- },
- },
- rules: [{ required: true }],
+ rules: [{ required: true, message: '请选择合同类别' }],
},
ctrTwoType: {
title: '二级类别',
@@ -89,25 +56,13 @@ export function getFormSchema(params: any = {}) {
prototype: true,
dict: dict({
async getData({ form = {} }) {
+ console.log(form);
return filterContractTypes(contractTypeData, form.ctrType);
},
}),
+ disabled: readOnly,
},
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- const data = filterContractTypes(contractTypeData, form.ctrType);
- for (const item of data) {
- if (item.value === form.ctrTwoType) {
- return {item.label};
- }
- }
- return ;
- },
- },
- rules: [{ required: true }],
+ rules: [{ required: true, message: '请选择二级类别' }],
},
frameProtocol: {
title: '框架协议',
@@ -119,19 +74,9 @@ export function getFormSchema(params: any = {}) {
dict: dict({
data: getDictOptions(DICT_TYPE.common_whether),
}),
+ disabled: readOnly,
},
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- return (
-
- {getDictObj(DICT_TYPE.common_whether, form.frameProtocol)?.label}
-
- );
- },
- },
+ rules: [{ required: true, message: '请选择框架协议' }],
},
frameProtocolCtr: {
title: '框架协议下的合同',
@@ -144,22 +89,9 @@ export function getFormSchema(params: any = {}) {
dict: dict({
data: getDictOptions(DICT_TYPE.common_whether),
}),
+ disabled: readOnly,
},
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- return (
-
- {
- getDictObj(DICT_TYPE.common_whether, form.frameProtocolCtr)
- ?.label
- }
-
- );
- },
- },
+ rules: [{ required: true, message: '请选择框架协议下的合同' }],
},
fundAllocation: {
title: '资金流向',
@@ -173,6 +105,7 @@ export function getFormSchema(params: any = {}) {
dict: dict({
data: getDictOptions(DICT_TYPE.contract_fund_flow),
}),
+ disabled: readOnly,
},
valueChange: {
immediate: true, // 是否立即执行一次
@@ -183,21 +116,6 @@ export function getFormSchema(params: any = {}) {
)?.label;
},
},
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- return (
-
- {
- getDictObj(DICT_TYPE.contract_fund_flow, form.fundAllocation)
- ?.label
- }
-
- );
- },
- },
rules: [{ required: true, message: '请选择资金流向' }],
},
fundDitch: {
@@ -212,21 +130,7 @@ export function getFormSchema(params: any = {}) {
dict: dict({
data: getDictOptions(DICT_TYPE.contract_funding_source),
}),
- },
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- return (
-
- {
- getDictObj(DICT_TYPE.contract_funding_source, form.fundDitch)
- ?.label
- }
-
- );
- },
+ disabled: readOnly,
},
rules: [{ required: true, message: '请选择资金渠道' }],
},
@@ -241,14 +145,7 @@ export function getFormSchema(params: any = {}) {
class: 'w-full',
min: 0,
max: 9999,
- },
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- return {form.budgetSum};
- },
+ disabled: readOnly,
},
},
priceType: {
@@ -263,23 +160,7 @@ export function getFormSchema(params: any = {}) {
dict: dict({
data: getDictOptions(DICT_TYPE.contract_currency_unit),
}),
- },
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- return (
-
- {
- getDictObj(
- DICT_TYPE.contract_currency_unit,
- form.priceType || '',
- )?.label
- }
-
- );
- },
+ disabled: readOnly,
},
},
organiza: {
@@ -290,25 +171,11 @@ export function getFormSchema(params: any = {}) {
name: 'fs-dict-radio',
vModel: 'value',
allowClear: false,
- class: 'min-w-[200px]',
+ class: 'min-w-[180px]',
dict: dict({
- data: getDictOptions(DICT_TYPE.contract_organization_form),
+ data: getDictOptions(DICT_TYPE.contract_organization_form, 'number'),
}),
- },
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- return (
-
- {
- getDictObj(DICT_TYPE.contract_organization_form, form.organiza)
- ?.label
- }
-
- );
- },
+ disabled: readOnly,
},
rules: [{ required: true, message: '请选择组织形式' }],
},
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 7c8ee90c..0591684d 100644
--- a/apps/web-contract/src/views/contract/approval/edit/index.vue
+++ b/apps/web-contract/src/views/contract/approval/edit/index.vue
@@ -10,6 +10,7 @@ import { message, Modal, type UploadChangeParam } from 'ant-design-vue';
import { logger } from 'common-utils';
import Apis from '#/api';
+import temporaryFormModal from '#/components/temporary-form-modal/temporary-form-modal.vue';
import { useVxeTable } from '#/hooks/vxeTable';
import { DICT_TYPE, getDictObj } from '#/utils/dict';
import { FileUploader } from '#/utils/file';
@@ -29,6 +30,10 @@ const [ChooseSigningBasisModal, chooseSigningBasisModalApi] = useVbenModal({
connectedComponent: chooseSigningBasisModal,
});
+const [TemporaryFormModal, temporaryFormModalApi] = useVbenModal({
+ connectedComponent: temporaryFormModal,
+});
+
const userStore = useUserStore();
const userInfo = computed(() => userStore.userInfo);
@@ -38,9 +43,10 @@ const fileUploader = new FileUploader({});
const router = useRouter();
const route = useRoute();
const id = ref(route.params.id);
+const auditId = ref();
const pageRef = ref();
-const currData = ref(null);
+const currData = ref({});
const formRef = ref();
@@ -211,9 +217,23 @@ async function handleSave() {
try {
await formRef.value.submit();
+ } catch {
+ message.error('请完成必填项的填写');
+ return;
+ }
+ try {
let newForm: any = {};
+ // 判断有没有签约依据
+ const tableFullData = xGridRef.value?.getTableData().fullData;
+ if (tableFullData && tableFullData.length > 0) {
+ newForm.basisId = tableFullData[0].basisId;
+ } else {
+ message.error('请选择签约依据');
+ return;
+ }
+
// 会议附件
const fileList = formRef.value.form.fileList;
let files: any = [];
@@ -257,18 +277,10 @@ async function handleSave() {
let result: any = {};
- // 判断有没有签约依据
- const tableFullData = xGridRef.value?.getTableData().fullData;
- if (tableFullData && tableFullData.length > 0) {
- newForm.basisId = tableFullData[0].basisId;
- } else {
- message.error('请选择签约依据');
- return;
- }
-
result = await Apis.contractBaseInfo.post_apply({ data: newForm });
id.value = result.value;
+ auditId.value = result.value;
message.success('保存成功');
Modal.confirm({
@@ -297,6 +309,93 @@ async function handleSubmit() {
chooseUserModalApi.open();
}
+async function handleAudit(
+ type: 'accessConfirm' | 'reject' | 'rejectConfirm',
+ data: any,
+) {
+ console.log(type);
+
+ if (type === 'accessConfirm') {
+ Modal.confirm({
+ title: '提示',
+ content: '是否确认审核通过?',
+ onOk: async () => {
+ try {
+ await Apis.contractBaseInfo.post_submit({
+ 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('退回失败,请稍候再试');
+ }
+ }
+}
+
onMounted(async () => {
isLoading.value = true;
@@ -311,7 +410,8 @@ onMounted(async () => {
params: { guid: id.value },
});
- currData.value = data;
+ auditId.value = id.value;
+ currData.value = data || {};
formBinding.value.columns = getFormSchema({
contractTypeData: contractTypeData.value,
@@ -325,6 +425,7 @@ onMounted(async () => {
);
nextTick(() => {
+ console.log(formRef.value);
formRef.value.setFormData(data);
});
@@ -380,6 +481,11 @@ onMounted(async () => {
+
+
{
保存
提交
+
+ 通过
+
+
+ 退回
+
{
- item.label = item.contrLevelName;
- item.value = item.contrLevelId;
- return item;
- })
- .filter((item) => item.parentId === parentId);
- } catch (error) {
- console.log(error);
- return [];
- }
-}
-
-export function getColumns(params: any = {}): VxeGridPropTypes.Columns {
+export function getColumns(_params: any = {}): VxeGridPropTypes.Columns {
return [
{
type: 'radio',
@@ -216,8 +194,8 @@ export function getFormSchema(_params: any = {}) {
vModel: 'value',
class: 'min-w-[200px]',
dict: dict({
- async getData({ form = {} }) {
- return await filterContractTypes('-1');
+ async getData(_context) {
+ return await getContractTypes('-1');
},
}),
},
diff --git a/apps/web-contract/src/views/contract/business/edit/basic-info-curd.tsx b/apps/web-contract/src/views/contract/business/edit/basic-info-curd.tsx
index bd47160c..dfd38092 100644
--- a/apps/web-contract/src/views/contract/business/edit/basic-info-curd.tsx
+++ b/apps/web-contract/src/views/contract/business/edit/basic-info-curd.tsx
@@ -1,20 +1,7 @@
import { dict } from '@fast-crud/fast-crud';
import { DICT_TYPE, getDictOptions } from '#/utils/dict';
-
-/**
- * 筛选合同列表数据
- *
- */
-function filterContractTypes(contractTypeData: any = [], parentId: string) {
- return contractTypeData
- .map((item) => {
- item.label = item.contrLevelName;
- item.value = item.contrLevelId;
- return item;
- })
- .filter((item) => item.parentId === parentId);
-}
+import { filterContractTypes } from '#/views/contract/utils';
export function getFormSchema(params: any = {}) {
const { contractTypeData } = params;
@@ -81,10 +68,7 @@ export function getFormSchema(params: any = {}) {
class: 'min-w-[200px]',
dict: dict({
async getData({ form = {} }) {
- if (form.ctrType) {
- return filterContractTypes(contractTypeData, form.ctrType);
- }
- return contractTypeData;
+ return filterContractTypes(contractTypeData, form.ctrType);
},
}),
},
diff --git a/apps/web-contract/src/views/contract/business/list/index.vue b/apps/web-contract/src/views/contract/business/list/index.vue
index 2badbb08..1f80e758 100644
--- a/apps/web-contract/src/views/contract/business/list/index.vue
+++ b/apps/web-contract/src/views/contract/business/list/index.vue
@@ -32,7 +32,7 @@ const gridOptions = reactive(
autoLoad: false,
ajax: {
query: async ({ page }) => {
- const data = await Apis.contractBaseInfo.get_page({
+ const data = await Apis.selectMerchantsBasicInfo.get_page({
params: {
pageNum: page.currentPage,
pageSize: page.pageSize,
diff --git a/apps/web-contract/src/views/contract/company/list/choose-company-modal.vue b/apps/web-contract/src/views/contract/company/list/choose-company-modal.vue
index 2f10853d..c9f5d4f9 100644
--- a/apps/web-contract/src/views/contract/company/list/choose-company-modal.vue
+++ b/apps/web-contract/src/views/contract/company/list/choose-company-modal.vue
@@ -37,6 +37,7 @@ const data = ref({
});
const checkRecords = ref([]);
+const limitMultipleNum = ref(1);
const searchBinding = ref({
...getFormSchema(),
@@ -70,7 +71,7 @@ const gridOptions = reactive(
},
},
rowConfig: {
- keyField: 'providerId',
+ keyField: 'guid',
},
checkboxConfig: {
labelField: 'providerId',
@@ -84,7 +85,7 @@ const gridOptions = reactive(
const checkRecordIds =
checkRecords.value.map((item) => item.guid) || [];
if (
- checkRecords.value.length === 0 ||
+ checkRecords.value.length < limitMultipleNum.value ||
checkRecordIds.includes(row.guid)
) {
return true;
@@ -123,8 +124,8 @@ function handleCheckboxChange(e) {
}
console.log('[ checkRecords.value ] >', checkRecords.value);
- if (allRows.length > 0) {
- messageApi.warning('最多只能选择1条数据');
+ if (allRows.length >= limitMultipleNum.value) {
+ messageApi.warning(`最多只能选择${limitMultipleNum.value}条数据`);
}
}
@@ -145,7 +146,10 @@ const [BaseModal, baseModalApi] = useVbenModal({
if (data.value.title) {
title.value = data.value.title;
}
- console.log(data.value.userIds);
+ if (data.value.limitMultipleNum) {
+ limitMultipleNum.value = data.value.limitMultipleNum;
+ }
+ console.log(data.value.guids);
const rows: any = [];
for (const element of checkRecords.value) {
if (data.value.guids.includes(element.guid)) {
@@ -195,7 +199,11 @@ const [BaseModal, baseModalApi] = useVbenModal({
v-bind="gridOptions"
@cell-click="handleCellClick"
@checkbox-change="handleCheckboxChange"
- />
+ >
+
+ {{ row.providerName }}
+
+
diff --git a/apps/web-contract/src/views/contract/components/todo-page/todo-page.vue b/apps/web-contract/src/views/contract/components/todo-page/todo-page.vue
index 1c973804..6b231d46 100644
--- a/apps/web-contract/src/views/contract/components/todo-page/todo-page.vue
+++ b/apps/web-contract/src/views/contract/components/todo-page/todo-page.vue
@@ -1,12 +1,13 @@
-
+
-
-
+
至
-
-
+
-
+ />
至
-
+ />
@@ -148,8 +133,8 @@ const searchForm = ref({
diff --git a/apps/web-contract/src/views/contract/declaration/print/index.vue b/apps/web-contract/src/views/contract/declaration/print/index.vue
index 6bffb05b..bfeb981b 100644
--- a/apps/web-contract/src/views/contract/declaration/print/index.vue
+++ b/apps/web-contract/src/views/contract/declaration/print/index.vue
@@ -2,65 +2,23 @@
import { computed, onMounted, reactive, ref } from 'vue';
import { useRouter } from 'vue-router';
-import { Page, useVbenModal } from '@vben/common-ui';
+import { Page } from '@vben/common-ui';
import { MdiRadioChecked, MdiRadioUnchecked } from '@vben/icons';
import { message } from 'ant-design-vue';
+import { logger } from 'common-utils';
import Apis from '#/api';
import { useVxeTable } from '#/hooks/vxeTable';
-import { getMonthStartAndEnd } from '#/utils/time';
import { getColumns, getFormSchema, PrimaryKey } from './crud.tsx';
const router = useRouter();
-const checkedValue = ref('all');
-const exportSearchParams = ref({
- daterange: getMonthStartAndEnd(),
-});
-
const searchRef = ref();
-const isConfirmLoading = ref(false);
-const [_Modal, modalApi] = useVbenModal({
- async onConfirm() {
- isConfirmLoading.value = true;
-
- try {
- let params = {};
- if (checkedValue.value == 'daterange') {
- params = {
- startDate: exportSearchParams.value.daterange[0],
- endDate: exportSearchParams.value.daterange[1],
- };
- }
- const res = await Apis.zbgl
- .post_export({
- params,
- config: {
- meta: {
- responseType: 'blob',
- },
- },
- })
- .send();
- message.success('导出成功');
- modalApi.close();
- showExportModal.value = false;
- } catch (error) {
- console.error(error);
- } finally {
- isConfirmLoading.value = false;
- }
-
- console.info('onConfirm');
- },
-});
const { xGridRef, triggerProxy, gridProps } = useVxeTable({ ref: 'xGridRef' });
-const treeData = ref([]);
-
/** Hooks - 表格 */
const gridOptions = reactive(
gridProps({
@@ -131,20 +89,27 @@ onMounted(() => {
const searchForm = ref({
...getFormSchema(),
- onSearch(context: any) {
+ onSearch(_context: any) {
triggerProxy('reload');
},
});
-
-function toPage() {
- window.open('/iframe/meeting/standing-book', '_blank');
-}
-
function toDetail(row) {
window.open(`/iframe/meeting/start/${row.guid}`, '_blank');
}
-function handlePrint(row, type: string) {}
+async function handlePrint(row, type: string) {
+ const hideLoading = message.loading('加载中', 0);
+ try {
+ const form: any = {};
+ await Apis.qdSign.get_printApprove({
+ params: form,
+ });
+ } catch (error) {
+ logger.error('打印失败', error);
+ } finally {
+ hideLoading();
+ }
+}
@@ -187,6 +152,10 @@ function handlePrint(row, type: string) {}
>
签约确认
+
+
+ 导出
+
diff --git a/apps/web-contract/src/views/contract/perform/list/index.vue b/apps/web-contract/src/views/contract/perform/list/index.vue
index 48cc8b71..3587b876 100644
--- a/apps/web-contract/src/views/contract/perform/list/index.vue
+++ b/apps/web-contract/src/views/contract/perform/list/index.vue
@@ -2,72 +2,27 @@
import { computed, onMounted, reactive, ref } from 'vue';
import { useRouter } from 'vue-router';
-import { Page, useVbenModal } from '@vben/common-ui';
+import { Page } from '@vben/common-ui';
import {
- MdiAdd,
- MdiDelete,
MdiExport,
MdiRadioChecked,
MdiRadioUnchecked,
MdiUpdate,
} from '@vben/icons';
-import { message, Modal } from 'ant-design-vue';
+import { message } from 'ant-design-vue';
import Apis from '#/api';
import { useVxeTable } from '#/hooks/vxeTable';
-import { getMonthStartAndEnd } from '#/utils/time';
import { getColumns, getFormSchema, PrimaryKey } from './crud.tsx';
const router = useRouter();
-const checkedValue = ref('all');
-const exportSearchParams = ref({
- daterange: getMonthStartAndEnd(),
-});
-
const searchRef = ref();
-const isConfirmLoading = ref(false);
-const [_Modal, modalApi] = useVbenModal({
- async onConfirm() {
- isConfirmLoading.value = true;
-
- try {
- let params = {};
- if (checkedValue.value == 'daterange') {
- params = {
- startDate: exportSearchParams.value.daterange[0],
- endDate: exportSearchParams.value.daterange[1],
- };
- }
- const res = await Apis.zbgl
- .post_export({
- params,
- config: {
- meta: {
- responseType: 'blob',
- },
- },
- })
- .send();
- message.success('导出成功');
- modalApi.close();
- showExportModal.value = false;
- } catch (error) {
- console.error(error);
- } finally {
- isConfirmLoading.value = false;
- }
-
- console.info('onConfirm');
- },
-});
const { xGridRef, triggerProxy, gridProps } = useVxeTable({ ref: 'xGridRef' });
-const treeData = ref([]);
-
/** Hooks - 表格 */
const gridOptions = reactive(
gridProps({
@@ -76,7 +31,7 @@ const gridOptions = reactive(
autoLoad: false,
ajax: {
query: ({ page }) => {
- return Apis.contractBaseInfo.get_page({
+ return Apis.personTask.get_pagePerformanceAudit({
params: {
pageNum: page.currentPage,
pageSize: page.pageSize,
@@ -98,29 +53,9 @@ const gridOptions = reactive(
function handleEdit(record?: any) {
if (record && record[PrimaryKey]) {
router.push(`/contract/perform/edit/${record[PrimaryKey]}`);
- } else {
- router.push('/contract/perform/edit');
}
}
-function handleDelete(row) {
- Modal.confirm({
- title: '提示',
- content: '是否确认删除该条记录?',
- okType: 'danger',
- onOk: async () => {
- await Apis.contractBaseInfo.post_deletes({
- params: { ids: row[PrimaryKey] },
- });
- message.success('删除成功');
- triggerProxy('reload');
- },
- onCancel() {
- console.log('Cancel');
- },
- });
-}
-
function handleExport() {
const $grid = xGridRef.value;
if ($grid) {
@@ -156,45 +91,15 @@ onMounted(() => {
const searchForm = ref({
...getFormSchema(),
- onSearch(context: any) {
+ onSearch(_context: any) {
triggerProxy('reload');
},
});
-
-function toPage() {
- window.open('/iframe/meeting/standing-book', '_blank');
-}
-
-function toDetail(row) {
- window.open(`/iframe/meeting/start/${row.guid}`, '_blank');
-}
-// 页面打开后获取列表数据
-
-
-
- 至
-
-
-
-
- 至
-
-
-
+
-
-
- 新增
-
导出
-
-
- 删除
-
diff --git a/apps/web-contract/src/views/contract/schema.ts b/apps/web-contract/src/views/contract/schema.ts
index ae01b77f..366daee5 100644
--- a/apps/web-contract/src/views/contract/schema.ts
+++ b/apps/web-contract/src/views/contract/schema.ts
@@ -12,7 +12,7 @@ export const PrimaryKey = 'guid';
export function getTodoColumns(_params: any = {}): VxeGridPropTypes.Columns {
return [
{ type: 'seq', width: 50, align: 'center', fixed: 'left' },
- { field: 'contractId', title: '编号', width: 100 },
+ { field: 'contractId', title: '编号', width: 150 },
{
field: 'contractName',
title: '名称',
diff --git a/apps/web-contract/src/views/contract/sign-authorization/edit/curd.tsx b/apps/web-contract/src/views/contract/sign-authorization/edit/curd.tsx
index 51d9bab8..c278d5fb 100644
--- a/apps/web-contract/src/views/contract/sign-authorization/edit/curd.tsx
+++ b/apps/web-contract/src/views/contract/sign-authorization/edit/curd.tsx
@@ -10,7 +10,7 @@ import { VxeGrid, type VxeGridPropTypes } from 'vxe-table';
import { unitComponentProps } from '#/common/unit';
import {
DICT_TYPE,
- getDictObj,
+ getDictObjByOptions,
getDictOptions,
getDictOptionsAsync,
} from '#/utils/dict';
@@ -66,6 +66,8 @@ export function getFormSchema(params?: any): any {
}
};
+ const dictMap: any = {};
+
return {
col: { span: 24 },
initialForm: {
@@ -128,17 +130,17 @@ export function getFormSchema(params?: any): any {
allowClear: false,
dict: dict({
async getData(_context) {
- return await getDictOptionsAsync(
- DICT_TYPE.contract_authorization_type2,
- );
+ const type = DICT_TYPE.contract_authorization_type2;
+ dictMap[type] = await getDictOptionsAsync(type);
+ return dictMap[type];
},
}),
},
valueChange: {
immediate: true, // 是否立即执行一次
- handle({ form }) {
- form.consignTypeName = getDictObj(
- DICT_TYPE.contract_authorization_type,
+ async handle({ form }) {
+ form.consignTypeName = getDictObjByOptions(
+ dictMap[DICT_TYPE.contract_authorization_type2],
form.consignType,
)?.label;
},
diff --git a/apps/web-contract/src/views/contract/sign/edit/curd.tsx b/apps/web-contract/src/views/contract/sign/edit/curd.tsx
index 1a845247..ecebee1a 100644
--- a/apps/web-contract/src/views/contract/sign/edit/curd.tsx
+++ b/apps/web-contract/src/views/contract/sign/edit/curd.tsx
@@ -1,320 +1,147 @@
import { dict } from '@fast-crud/fast-crud';
-import { DICT_TYPE, getDictObj, getDictOptions } from '#/utils/dict';
-
-/**
- * 筛选合同列表数据
- *
- */
-function filterContractTypes(contractTypeData: any = [], parentId: string) {
- return contractTypeData
- .map((item) => {
- item.label = item.contrLevelName;
- item.value = item.contrLevelId;
- return item;
- })
- .filter((item) => item.parentId === parentId);
-}
+import { DICT_TYPE, getDictOptionsAsync } from '#/utils/dict';
export function getFormSchema(params: any = {}) {
- const { contractTypeData, readOnly = false } = params;
+ const { readOnly = false } = params;
return {
- contractName: {
- title: '合同名称',
- key: 'contractName',
- col: { span: 24 },
- component: {
- name: 'a-input',
- vModel: 'value',
- allowClear: false,
- },
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- return {form.contractName};
- },
- },
- rules: [{ required: true }],
+ col: { span: 24 },
+ labelCol: { style: { width: '120px' } },
+ initialForm: {
+ ourStampName: '克拉玛依市热力有限责任公司合同专用章',
},
- ctrType: {
- title: '合同类别',
- key: 'ctrType',
- col: { span: 12 },
- component: {
- name: 'fs-dict-select',
- vModel: 'value',
- class: 'min-w-[200px]',
- prototype: true,
- dict: dict({
- async getData(_context) {
- return filterContractTypes(contractTypeData, '-1');
- },
- }),
- },
- valueChange: {
- immediate: true, // 是否立即执行一次
- handle({ form, value, getComponentRef }) {
- form.ctrTwoType = undefined;
- console.log(getComponentRef('ctrTwoType'));
- getComponentRef('ctrTwoType').reloadDict(); // 执行city的select组件的reloadDict()方法,触发“city”重新加载字典
+ columns: {
+ contractName: {
+ title: '合同名称',
+ key: 'contractName',
+ col: { span: 12 },
+ component: {
+ name: 'a-input',
+ vModel: 'value',
+ allowClear: false,
+ disabled: readOnly,
},
},
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- const data = filterContractTypes(contractTypeData, '-1');
- for (const item of data) {
- if (item.value === form.ctrType) {
- return {item.label};
- }
- }
- return ;
+ contractNumber: {
+ title: '合同编号',
+ key: 'contractNumber',
+ col: { span: 12 },
+ component: {
+ name: 'a-input',
+ vModel: 'value',
+ allowClear: false,
+ disabled: readOnly,
},
},
- rules: [{ required: true }],
- },
- ctrTwoType: {
- title: '二级类别',
- key: 'ctrTwoType',
- col: { span: 12 },
- component: {
- name: 'fs-dict-select',
- vModel: 'value',
- class: 'min-w-[200px]',
- prototype: true,
- dict: dict({
- async getData({ form = {} }) {
- return filterContractTypes(contractTypeData, form.ctrType);
- },
- }),
- },
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- const data = filterContractTypes(contractTypeData, form.ctrType);
- for (const item of data) {
- if (item.value === form.ctrTwoType) {
- return {item.label};
- }
- }
- return ;
+ signUserName: {
+ title: '我方签约人',
+ key: 'signUserName',
+ col: { span: 12 },
+ component: {
+ name: 'a-input',
+ vModel: 'value',
+ disabled: readOnly,
},
},
- rules: [{ required: true }],
- },
- frameProtocol: {
- title: '框架协议',
- key: 'frameProtocol',
- col: { span: 8 },
- component: {
- name: 'fs-dict-radio',
- vModel: 'value',
- dict: dict({
- data: getDictOptions(DICT_TYPE.common_whether),
- }),
- },
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- return (
-
- {getDictObj(DICT_TYPE.common_whether, form.frameProtocol)?.label}
-
- );
+ signTime: {
+ title: '我方签字时间',
+ key: 'signTime',
+ col: { span: 12 },
+ component: {
+ name: 'a-date-picker',
+ vModel: 'value',
+ valueFormat: 'YYYY-MM-DD',
},
},
- },
- frameProtocolCtr: {
- title: '框架协议下的合同',
- key: 'frameProtocolCtr',
- col: { span: 12 },
- labelCol: { style: { width: '200px' } },
- component: {
- name: 'fs-dict-radio',
- vModel: 'value',
- dict: dict({
- data: getDictOptions(DICT_TYPE.common_whether),
- }),
- },
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- return (
-
- {
- getDictObj(DICT_TYPE.common_whether, form.frameProtocolCtr)
- ?.label
- }
-
- );
+ providerName: {
+ title: '合同相对人',
+ key: 'providerName',
+ col: { span: 12 },
+ component: {
+ name: 'a-input',
+ vModel: 'value',
+ readOnly: true,
+ placeholder: '请选择合同相对人',
+ disabled: readOnly,
},
},
- },
- fundAllocation: {
- title: '资金流向',
- key: 'fundAllocation',
- col: { span: 12 },
- component: {
- name: 'fs-dict-select',
- vModel: 'value',
- allowClear: false,
- class: 'min-w-[200px]',
- dict: dict({
- data: getDictOptions(DICT_TYPE.contract_fund_flow),
- }),
+ providerSigner: {
+ title: '对方签约人',
+ key: 'providerSigner',
+ col: { span: 12 },
+ component: {
+ name: 'a-input',
+ vModel: 'value',
+ readOnly: true,
+ placeholder: '请输入对方签约人',
+ },
+ rules: [{ required: true, message: '请输入对方签约人' }],
},
- valueChange: {
- immediate: true, // 是否立即执行一次
- handle({ form }) {
- form.fundAllocationName = getDictObj(
- DICT_TYPE.contract_fund_flow,
- form.fundAllocation,
- )?.label;
+ ourStamp: {
+ title: '我方盖章人',
+ key: 'ourStamp',
+ col: { span: 12 },
+ component: {
+ name: 'a-input',
+ vModel: 'value',
},
},
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- return (
-
- {
- getDictObj(DICT_TYPE.contract_fund_flow, form.fundAllocation)
- ?.label
- }
-
- );
+ ourStampDate: {
+ title: '我方盖章(签订)时间',
+ key: 'ourStampDate',
+ col: { span: 12 },
+ component: {
+ name: 'a-date-picker',
+ vModel: 'value',
+ valueFormat: 'YYYY-MM-DD',
},
},
- rules: [{ required: true, message: '请选择资金流向' }],
- },
- fundDitch: {
- title: '资金渠道',
- key: 'fundDitch',
- col: { span: 12 },
- component: {
- name: 'fs-dict-select',
- vModel: 'value',
- allowClear: false,
- class: 'min-w-[200px]',
- dict: dict({
- data: getDictOptions(DICT_TYPE.contract_funding_source),
- }),
- },
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- return (
-
- {
- getDictObj(DICT_TYPE.contract_funding_source, form.fundDitch)
- ?.label
- }
-
- );
+ ourStampName: {
+ title: '我方用章名称',
+ key: 'ourStampName',
+ col: { span: 12 },
+ component: {
+ name: 'a-input',
+ vModel: 'value',
+ disabled: readOnly,
},
},
- rules: [{ required: true, message: '请选择资金渠道' }],
- },
- budgetSum: {
- title: '预算金额',
- key: 'budgetSum',
- col: { span: 8 },
- colon: false,
- component: {
- name: 'a-input-number',
- vModel: 'value',
- class: 'w-full',
- min: 0,
- max: 9999,
- },
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- return {form.budgetSum};
+ signPlace: {
+ title: '签订地点',
+ key: 'signPlace',
+ col: { span: 12 },
+ component: {
+ name: 'a-input',
+ vModel: 'value',
},
},
- },
- priceType: {
- title: '',
- key: 'priceType',
- col: { span: 6 },
- labelCol: { style: { width: '12px' } },
- colon: false,
- component: {
- name: 'fs-dict-select',
- vModel: 'value',
- dict: dict({
- data: getDictOptions(DICT_TYPE.contract_currency_unit),
- }),
- },
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- return (
-
- {
- getDictObj(
- DICT_TYPE.contract_currency_unit,
- form.priceType || '',
- )?.label
- }
-
- );
+ effectType: {
+ title: '合同成立时生效',
+ key: 'effectType',
+ col: { span: 12 },
+ component: {
+ name: 'fs-dict-select',
+ vModel: 'value',
+ allowClear: false,
+ class: 'min-w-[180px]',
+ dict: dict({
+ getData: async () => {
+ return await getDictOptionsAsync(DICT_TYPE.common_whether);
+ },
+ }),
},
},
- },
- organiza: {
- title: '组织形式',
- key: 'organiza',
- col: { span: 24 },
- component: {
- name: 'fs-dict-radio',
- vModel: 'value',
- allowClear: false,
- class: 'min-w-[200px]',
- dict: dict({
- data: getDictOptions(DICT_TYPE.contract_organization_form),
- }),
- },
- conditionalRender: {
- match({ form }) {
- return readOnly;
- },
- render({ form }) {
- return (
-
- {
- getDictObj(DICT_TYPE.contract_organization_form, form.organiza)
- ?.label
- }
-
- );
+ buildDate: {
+ title: '合同成立时间',
+ key: 'buildDate',
+ col: { span: 12 },
+ component: {
+ name: 'a-date-picker',
+ vModel: 'value',
+ valueFormat: 'YYYY-MM-DD',
},
},
- rules: [{ required: true, message: '请选择组织形式' }],
- },
- fileList: {
- title: '相关附件',
- key: 'fileList',
},
};
}
diff --git a/apps/web-contract/src/views/contract/sign/edit/index.vue b/apps/web-contract/src/views/contract/sign/edit/index.vue
index f609edf9..d54be4f6 100644
--- a/apps/web-contract/src/views/contract/sign/edit/index.vue
+++ b/apps/web-contract/src/views/contract/sign/edit/index.vue
@@ -45,10 +45,11 @@ const isLoading = ref(false);
const contractTypeData = ref([]);
const formBinding = ref({
- col: { span: 24 },
- labelCol: { style: { width: '120px' } },
- initialForm: {},
- columns: {},
+ ...(({ columns: _, ...rest }) => rest)(
+ getFormSchema({
+ formRef,
+ }),
+ ),
});
const formBindingByText = ref({
@@ -293,7 +294,7 @@ onMounted(async () => {
formBinding.value.columns = getFormSchema({
contractTypeData: contractTypeData.value,
readOnly: !id.value || currData.value.step !== 'edit',
- });
+ }).columns;
nextTick(() => {
formRef.value.setFormData(data);
diff --git a/apps/web-contract/src/views/contract/sign/list/crud.tsx b/apps/web-contract/src/views/contract/sign/list/crud.tsx
index 79a44433..1dc099e0 100644
--- a/apps/web-contract/src/views/contract/sign/list/crud.tsx
+++ b/apps/web-contract/src/views/contract/sign/list/crud.tsx
@@ -1,7 +1,6 @@
import type { VxeGridPropTypes } from 'vxe-table';
import { dict } from '@fast-crud/fast-crud';
-import dayjs from 'dayjs';
import { useRender } from '#/hooks/useRender';
import { DICT_TYPE, getDictOptions } from '#/utils/dict';
@@ -82,9 +81,7 @@ export function getColumns(_params?: any): VxeGridPropTypes.Columns {
export function getFormSchema(_params: any = {}) {
return {
- initialForm: {
- startDate: dayjs().startOf('month').format('YYYY-MM-DD'),
- },
+ initialForm: {},
columns: {
contractName: {
title: '合同名称',
diff --git a/apps/web-contract/src/views/contract/sign/list/index.vue b/apps/web-contract/src/views/contract/sign/list/index.vue
index d373aab7..5226339f 100644
--- a/apps/web-contract/src/views/contract/sign/list/index.vue
+++ b/apps/web-contract/src/views/contract/sign/list/index.vue
@@ -26,7 +26,7 @@ const gridOptions = reactive(
autoLoad: false,
ajax: {
query: async ({ page }) => {
- const data = await Apis.contractBaseInfo.get_page({
+ const data = await Apis.qdSign.get_page({
params: {
pageNum: page.currentPage,
pageSize: page.pageSize,
diff --git a/apps/web-contract/src/views/contract/sign/todo/index.vue b/apps/web-contract/src/views/contract/sign/todo/index.vue
index 827b86f0..45ee82af 100644
--- a/apps/web-contract/src/views/contract/sign/todo/index.vue
+++ b/apps/web-contract/src/views/contract/sign/todo/index.vue
@@ -1,182 +1,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
diff --git a/apps/web-contract/src/views/contract/utils.ts b/apps/web-contract/src/views/contract/utils.ts
index 95f7cada..b3d46bc8 100644
--- a/apps/web-contract/src/views/contract/utils.ts
+++ b/apps/web-contract/src/views/contract/utils.ts
@@ -1,23 +1,93 @@
+import Apis from '#/api';
+import { router } from '#/router';
+
+/**
+ * 前往详情页
+ * @param type
+ * @param id
+ */
+export function toDetail(type: string, id: string, params?: any) {
+ switch (type) {
+ case 'contractSetup': {
+ router.push(`/contract/approval/edit/${id}`);
+ break;
+ }
+ case 'selectMerchant': {
+ router.push(`/contract/business/edit/${id}`);
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+}
+
/**
* 前往详情页
* @param type
* @param id
*/
export function toDetailPage(type: string, id: string, params?: any) {
- const { contractId } = params;
+ const { contractId } = params || {};
const name = '合同详情'; // 网页名称,可为空;
const iWidth = 1200; // 弹出窗口的宽度;
const iHeight = 800; // 弹出窗口的高度;
// window.screen.height获得屏幕的高,window.screen.width获得屏幕的宽
const iTop = (window.screen.height - 30 - iHeight) / 2; // 获得窗口的垂直位置;
const iLeft = (window.screen.width - 10 - iWidth) / 2; // 获得窗口的水平位置;
+ const queryParams = new URLSearchParams();
+
+ if (type !== undefined) queryParams.append('type', type);
+ if (id !== undefined) queryParams.append('id', id);
+ if (contractId !== undefined) queryParams.append('contractId', contractId);
+
+ const url = `/iframe/contract/info?${queryParams.toString()}`;
+
window.open(
- `/iframe/contract/info?type=${type}&id=${id}&contractId=${contractId}`,
+ url,
name,
- `height=${iHeight},innerHeight=${iHeight},width=${iWidth},innerWidth=${
- iWidth
- },top=${iTop},left=${
- iLeft
- },toolbar=no,menubar=no,scrollbars=auto,resizable=no,location=no,status=no`,
+ `height=${iHeight},innerHeight=${iHeight},width=${iWidth},innerWidth=${iWidth},top=${iTop},left=${iLeft},toolbar=no,menubar=no,scrollbars=auto,resizable=no,location=no,status=no`,
);
}
+
+/**
+ * 筛选合同列表数据
+ */
+export async function getContractTypes(parentId: string) {
+ try {
+ const contractReferTypeData = await Apis.contractReferType.get_list({
+ params: {},
+ });
+ return contractReferTypeData.rows
+ .map((item) => {
+ item.label = item.contrLevelName;
+ item.value = item.contrLevelId;
+ return item;
+ })
+ .filter((item) => item.parentId === parentId);
+ } catch (error) {
+ console.log(error);
+ return [];
+ }
+}
+
+/**
+ * 筛选合同列表数据
+ */
+export function filterContractTypes(
+ contractTypeData: any = [],
+ parentId: string,
+) {
+ return contractTypeData
+ .map((item) => {
+ item.label = item.contrLevelName;
+ item.value = item.contrLevelId;
+ return item;
+ })
+ .filter((item) => {
+ if (parentId) {
+ return item.parentId === parentId;
+ }
+ return true;
+ });
+}
diff --git a/apps/web-contract/src/views/user-center/todo/index.vue b/apps/web-contract/src/views/user-center/todo/index.vue
index e5efdd5a..760043c9 100644
--- a/apps/web-contract/src/views/user-center/todo/index.vue
+++ b/apps/web-contract/src/views/user-center/todo/index.vue
@@ -7,6 +7,7 @@ import Apis from '#/api';
import { useVxeTable } from '#/hooks/vxeTable';
import { DICT_TYPE, getDictOptions } from '#/utils/dict';
import { getTodoColumns } from '#/views/contract/schema';
+import { toDetail, toDetailPage } from '#/views/contract/utils';
const { xGridRef, triggerProxy, gridProps } = useVxeTable({ ref: 'xGridRef' });
const { xGridRef: xGrid2Ref, triggerProxy: triggerProxy2 } = useVxeTable({
@@ -88,10 +89,6 @@ async function loadDataByDictType() {
treeData.value = [{ title: '全部', key: 'all', children: data }];
}
-function toDetail(row) {}
-
-function toDetailPage(row) {}
-
onMounted(() => {
loadDataByDictType();
});
@@ -126,7 +123,7 @@ onMounted(() => {
{{ row.contractName }}
@@ -136,7 +133,9 @@ onMounted(() => {
class="text-blue-500"
size="small"
type="text"
- @click="toDetailPage(row)"
+ @click="
+ toDetailPage('approval', '', { contractId: row.contractId })
+ "
>
查看
@@ -149,14 +148,16 @@ onMounted(() => {
size="small"
title="已办"
>
-
+
查看
diff --git a/apps/web-office/src/app.vue b/apps/web-office/src/app.vue
index db8fde7b..06f7d675 100644
--- a/apps/web-office/src/app.vue
+++ b/apps/web-office/src/app.vue
@@ -66,29 +66,50 @@ if (dictStore.initDict) {
}
.ant-checkbox-disabled .ant-checkbox-inner {
- background: #fdfdfd;
+ background: #fafafa;
+ color: #333;
+}
+
+.ant-input-number-disabled {
+ background: #fafafa;
+ color: #333;
}
.ant-input-affix-wrapper-disabled,
.ant-input-affix-wrapper[disabled] {
- background: #fdfdfd;
+ background: #fafafa;
color: #333;
}
+.ant-radio-wrapper-disabled {
+ background: #fafafa;
+ color: #333;
+}
+.ant-radio-wrapper .ant-radio-disabled .ant-radio-inner {
+ background-color: rgba(50, 54, 57, 0.04);
+ border-color: hsl(240 5.9% 90%);
+}
+
.ant-picker.ant-picker-disabled {
- background: #fdfdfd;
+ background: #fafafa;
+ color: #333;
+}
+
+.ant-select-disabled.ant-select:not(.ant-select-customize-input)
+ .ant-select-selector {
+ background: #fafafa;
color: #333;
}
.ant-picker .ant-picker-input > input-disabled,
.ant-picker .ant-picker-input > input[disabled] {
- background: #fdfdfd;
+ background: #fafafa;
color: #333 !important;
}
.ant-input-disabled,
.ant-input[disabled] {
- background: #fdfdfd;
+ background: #fafafa;
color: #333;
}
diff --git a/apps/web-office/src/layouts/basic.vue b/apps/web-office/src/layouts/basic.vue
index 49f03dae..f2016600 100644
--- a/apps/web-office/src/layouts/basic.vue
+++ b/apps/web-office/src/layouts/basic.vue
@@ -1,18 +1,25 @@
@@ -130,7 +139,7 @@ function handleMenuClick(e) {
-
+
正式
czg
zp
@@ -138,7 +147,7 @@ function handleMenuClick(e) {
xmh
- {{ value ? "代理" + value : "代理切换" }}
+ {{ value ? `代理${value}` : '代理切换' }}
-
+
diff --git a/apps/web-office/src/store/index.ts b/apps/web-office/src/store/index.ts
index f8a40031..b6a7763b 100644
--- a/apps/web-office/src/store/index.ts
+++ b/apps/web-office/src/store/index.ts
@@ -1,2 +1,2 @@
export * from './auth';
-export * from './dict'
+export * from './dict';
diff --git a/apps/web-office/src/utils/dict/index.ts b/apps/web-office/src/utils/dict/index.ts
index 05a1f496..3785b453 100644
--- a/apps/web-office/src/utils/dict/index.ts
+++ b/apps/web-office/src/utils/dict/index.ts
@@ -1,4 +1,6 @@
/** 数据字典工具类 */
+import { computed } from 'vue';
+
import Apis from '#/api';
import { useDictStore } from '#/store/dict';
import dataModule from '#/utils/dict/static.data';
@@ -7,6 +9,10 @@ export * from './shared';
const dictStore = useDictStore();
+const dictData = computed(() => {
+ return dictStore.dictMap;
+});
+
/**
* 获取 dictType 对应的数据字典数组
*
@@ -29,7 +35,7 @@ export interface DictDataOptions {
}
export function getDictDatas(dictType: string) {
- return dictStore.getDictMap[dictType] || [];
+ return dictData.value[dictType] || [];
}
export function getDictOpts(dictType: string) {
@@ -58,7 +64,7 @@ export async function getDictDatasAsync(dictTypes: string[]) {
dictDataMap[dictType].push({
...dictData,
value: dictData.value,
- label: dictData.name,
+ label: dictData.label,
colorType: dictData.colorType,
cssClass: dictData.cssClass,
} as DictDataType);
@@ -99,8 +105,7 @@ export function getDictOptions(
): any[] {
const dictOption: DictDataType[] = [];
valueType ||= 'string';
-
- const dictOptions: DictDataType[] = getDictDatas(dictType);
+ const dictOptions: DictDataType[] = dictData.value[dictType] || [];
if (dictOptions && dictOptions.length > 0) {
dictOptions.forEach((dict: DictDataType) => {
dictOption.push({
@@ -166,6 +171,42 @@ export function getDictObj(dictType: string, value: any): DictDataType | null {
}
}
+/** 获取指定 value 的字典数据 */
+export function getDictObjByOptions(
+ options: DictDataType[],
+ value: any,
+): DictDataType | null {
+ if (options) {
+ if (value) {
+ const result = options.find((dict: DictDataType) => dict.value === value);
+ return result || null;
+ }
+ return null;
+ } else {
+ return null;
+ }
+}
+
+/** 获取指定 value 的字典数据 */
+export async function getDictObjAsync(
+ dictType: string,
+ value: any,
+): Promise {
+ const dictOptions = await getDictOptionsAsync(dictType);
+ if (dictOptions) {
+ if (value) {
+ return (
+ dictOptions.find(
+ (dict: DictDataType) => dict.value === value.toString(),
+ ) || null
+ );
+ }
+ return null;
+ } else {
+ return null;
+ }
+}
+
/** 获取字典默认数据 */
export function getDictDefaultObj(dictType: string): DictDataType | null {
const dictOptions: DictDataType[] = getDictDatas(dictType);
diff --git a/apps/web-office/src/views/duty/list/duty-edit-modal.vue b/apps/web-office/src/views/duty/list/duty-edit-modal.vue
index f20ee3e9..63489270 100644
--- a/apps/web-office/src/views/duty/list/duty-edit-modal.vue
+++ b/apps/web-office/src/views/duty/list/duty-edit-modal.vue
@@ -1,12 +1,15 @@