@brms/ai-skills 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +256 -0
- package/bin/brms-skills.mjs +411 -0
- package/package.json +30 -0
- package/skills/brms-prototype-generator/SKILL.md +129 -0
- package/skills/brms-prototype-generator/agents/openai.yaml +7 -0
- package/skills/brms-prototype-generator/examples/few-shot-examples.md +577 -0
- package/skills/brms-prototype-generator/references/01-list-query.md +444 -0
- package/skills/brms-prototype-generator/references/02-form-entry.md +129 -0
- package/skills/brms-prototype-generator/references/03-detail-display.md +125 -0
- package/skills/brms-prototype-generator/references/04-composite-page-package.md +339 -0
- package/skills/brms-prototype-generator/references/05-dialog-patterns.md +113 -0
- package/skills/brms-prototype-generator/references/06-backend-request-patterns.md +118 -0
- package/skills/brms-prototype-generator/references/resource-index.md +46 -0
- package/skills/brms-prototype-generator/references/system-prompt.md +242 -0
- package/skills/brms-prototype-generator/scripts/analyze-doc.mjs +554 -0
- package/skills/brms-prototype-generator/scripts/check-project.mjs +228 -0
- package/skills/brms-prototype-generator/scripts/discover-targets.mjs +158 -0
- package/skills/brms-prototype-generator/scripts/install-codex.mjs +74 -0
- package/skills/brms-prototype-generator/scripts/plan-pages.mjs +390 -0
- package/skills/brms-prototype-generator/scripts/validate-generated.mjs +838 -0
- package/skills/brms-prototype-generator/templates/user-input-template.md +182 -0
- package/skills/brms-vxe-plus-developer/SKILL.md +105 -0
- package/skills/brms-vxe-plus-developer/agents/openai.yaml +7 -0
- package/skills/brms-vxe-plus-developer/references/prototype-to-real.md +54 -0
- package/skills/brms-vxe-plus-developer/references/real-base-development.md +110 -0
- package/skills/brms-vxe-plus-developer/references/resource-index.md +43 -0
- package/skills/brms-vxe-plus-developer/references/review-checklist.md +49 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/01-mental-model.md +150 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/02-vxe-plus-form.md +302 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/03-vxe-plus-table.md +253 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/04-example-map.md +488 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/05-request-and-eiinfo.md +170 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/90-anti-patterns.md +137 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/README.md +43 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/README.md +21 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/A1/P0/A1P01601.vue +483 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/A1/P1/A1P11011.vue +444 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/AB/BP/ABBP0201.vue +1648 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/AM/AF/component/AMAF0601/Bidding/formConfig.ts +228 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/AM/AF/component/AMAF0601/Record/columns.ts +110 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/BM/BR/BMBR01.vue +130 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/BM/BR/component/BMBR01/columns.ts +94 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/BM/BR/component/BMBR01/formConfig.ts +108 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Change/formConfig.ts +123 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Change/index.vue +103 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Clause/columns.ts +48 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Clause/index.vue +202 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Correcte/formConfig.ts +117 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Correcte/index.vue +103 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Pay/Payment/formConfig.ts +90 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Pay/Payment/index.vue +42 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Pay/columns.ts +376 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Pay/index.vue +619 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Settle/Domestic/formConfig.ts +73 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Settle/Domestic/index.vue +47 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Settle/Foreign/formConfig.ts +141 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Settle/Foreign/index.vue +42 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Settle/columns.ts +123 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/Settle/index.vue +593 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Explain/index.vue +68 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Fee/columns.ts +150 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Fee/index.vue +235 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Files/columns.ts +63 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Files/index.vue +117 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Goods/columns.ts +327 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Goods/index.vue +790 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Base/Approve/formConfig.ts +341 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Base/Approve/index.vue +63 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Base/Approve2/formConfig.ts +232 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Base/Approve2/index.vue +27 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Base/Diff/columns.ts +46 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Base/Diff/index.vue +92 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Base/formConfig.ts +979 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Base/index.vue +62 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Other/formConfig.ts +179 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Other/index.vue +140 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Sign/formConfig.ts +118 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/Sign/index.vue +44 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Main/index.vue +168 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Party/Major/formConfig.ts +257 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Party/Major/index.vue +47 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Party/columns.ts +256 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Party/index.vue +738 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Price/formConfig.ts +174 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Price/index.vue +51 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/PM/PC/component/PMPC0101/Top/index.vue +924 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/SM/SW/SMSW0101.vue +567 -0
- package/skills/brms-vxe-plus-developer/references/vxe-plus-knowledge/sources/project/base/src/views/demo/index.vue +448 -0
- package/skills/brms-vxe-plus-developer/scripts/check-project.mjs +259 -0
- package/skills/brms-vxe-plus-developer/scripts/check-vxe-plus-page.mjs +137 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 谢力
|
|
3
|
+
* @Date: 2025-06-26 15:30:28
|
|
4
|
+
* @LastEditors: Please set LastEditors
|
|
5
|
+
* @LastEditTime: 2025-10-10 21:16:52
|
|
6
|
+
*/
|
|
7
|
+
import { computed, inject, toValue } from 'vue'
|
|
8
|
+
import type { Ref } from 'vue'
|
|
9
|
+
import type { EiInfo } from '@eplat/ei'
|
|
10
|
+
import dayjs from 'dayjs'
|
|
11
|
+
import { useTable } from '@/hooks/useTable'
|
|
12
|
+
import { isEmpty } from '@/utils/is'
|
|
13
|
+
import LMLC9906 from '@/views/LM/LC/LMLC9906.vue'
|
|
14
|
+
import SMSC9916 from '@/views/SM/SC/SMSC9916.vue'
|
|
15
|
+
|
|
16
|
+
export function createTableColumns() {
|
|
17
|
+
const { createColumns, commonVxeInput, commonTableSelect, commonSelectDialog, createEditRules, validator } = useTable()
|
|
18
|
+
|
|
19
|
+
const { main: mainModule } = inject('__PMPC0101__module__') as { main: Ref }
|
|
20
|
+
|
|
21
|
+
const baseModule = computed(() => mainModule?.value?.base)
|
|
22
|
+
|
|
23
|
+
const baseModuleFormData = computed(() => baseModule?.value?.formData)
|
|
24
|
+
|
|
25
|
+
const initLoadEiInfo = toValue(inject<Ref<EiInfo> | undefined>('__eiInfo__', undefined))
|
|
26
|
+
// console.log('initLoadEiInfo', initLoadEiInfo)
|
|
27
|
+
|
|
28
|
+
const inquList = initLoadEiInfo?.getBlock('inqu_status')?.getMappedRows() || []
|
|
29
|
+
// console.log('inquList', inquList)
|
|
30
|
+
|
|
31
|
+
const columns = computed(() => {
|
|
32
|
+
return createColumns([
|
|
33
|
+
// {
|
|
34
|
+
// type: 'seq',
|
|
35
|
+
// width: 60,
|
|
36
|
+
// },
|
|
37
|
+
{
|
|
38
|
+
field: 'feeTypeName',
|
|
39
|
+
title: '费用商品名称',
|
|
40
|
+
editRender: commonSelectDialog({
|
|
41
|
+
title: '费用项信息',
|
|
42
|
+
width: 850,
|
|
43
|
+
component: SMSC9916,
|
|
44
|
+
fields: 'feeTypeName,cgFeeTypeCode',
|
|
45
|
+
dialogFields: 'estimationFeeTypeName,ceEstimationFeeTypeCode',
|
|
46
|
+
componentParam: {
|
|
47
|
+
param: {
|
|
48
|
+
bookId: baseModuleFormData.value?.bookId || '',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
}, {
|
|
52
|
+
events: {
|
|
53
|
+
change({ row }) {
|
|
54
|
+
if (isEmpty(row.feeTypeName)) {
|
|
55
|
+
row.cgFeeTypeCode = ''
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
}),
|
|
60
|
+
required: true,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
field: 'cgFeeTypeCode',
|
|
64
|
+
title: '费用商品代码',
|
|
65
|
+
required: true,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
field: 'feePayer',
|
|
69
|
+
title: '费用承担方',
|
|
70
|
+
editRender: commonTableSelect('brmerp.pm.expenseAfford'),
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
field: 'feeContractCode',
|
|
74
|
+
title: '费用合同号',
|
|
75
|
+
editRender: commonSelectDialog({
|
|
76
|
+
title: '费用合同号',
|
|
77
|
+
component: LMLC9906,
|
|
78
|
+
fields: 'feeContractCode,feeContractId',
|
|
79
|
+
dialogFields: 'lcContractCode,lcContractMainId',
|
|
80
|
+
componentParam: {
|
|
81
|
+
param: {
|
|
82
|
+
bookId: baseModuleFormData.value?.bookId || '',
|
|
83
|
+
__deptId__: baseModuleFormData.value?.deptId || '',
|
|
84
|
+
__orgId__: baseModuleFormData.value?.orgId || '',
|
|
85
|
+
operatorDepartmentCode: inquList[0]?.operatorDepartmentCode || '',
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
beforeOpen: () => {
|
|
89
|
+
if (isEmpty(baseModuleFormData.value?.orgId)) {
|
|
90
|
+
baseModule.value.updateInvalidFieldStatus({
|
|
91
|
+
field: 'orgId',
|
|
92
|
+
message: '请选择所属账套',
|
|
93
|
+
})
|
|
94
|
+
return Promise.reject('请先选择所属账套')
|
|
95
|
+
}
|
|
96
|
+
return Promise.resolve(true)
|
|
97
|
+
},
|
|
98
|
+
}, {
|
|
99
|
+
events: {
|
|
100
|
+
change({ row }) {
|
|
101
|
+
if (isEmpty(row.feeContractCode)) {
|
|
102
|
+
row.feeContractId = ''
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
}),
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
field: 'remark',
|
|
110
|
+
title: '备注',
|
|
111
|
+
editRender: commonVxeInput(),
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
field: 'createdTime',
|
|
115
|
+
title: '创建时间',
|
|
116
|
+
width: 150,
|
|
117
|
+
visible: false,
|
|
118
|
+
formatter: ({ cellValue }) => cellValue ? dayjs(cellValue).format('YYYY-MM-DD') : '',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
field: 'modifiedTime',
|
|
122
|
+
title: '更新时间',
|
|
123
|
+
width: 150,
|
|
124
|
+
visible: false,
|
|
125
|
+
formatter: ({ cellValue }) => cellValue ? dayjs(cellValue).format('YYYY-MM-DD') : '',
|
|
126
|
+
},
|
|
127
|
+
].map((col) => {
|
|
128
|
+
if (col.field !== 'seq') {
|
|
129
|
+
(col as any).slots = {
|
|
130
|
+
...(col as any).slots,
|
|
131
|
+
default: `${col.field}_default`,
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
...col,
|
|
136
|
+
width: (col as any).width ?? '',
|
|
137
|
+
} as any
|
|
138
|
+
})).value
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
const tableValidator = (...args: any[]) => {
|
|
142
|
+
return (validator as any)(...args)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return {
|
|
146
|
+
columns,
|
|
147
|
+
editRules: computed(() => createEditRules(columns.value)),
|
|
148
|
+
tableValidator,
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BxRoundedContainer>
|
|
3
|
+
<BxContainer title="费用信息">
|
|
4
|
+
<VxePlusTable
|
|
5
|
+
:id="tablePageId"
|
|
6
|
+
ref="xGrid"
|
|
7
|
+
class="pb0"
|
|
8
|
+
:auto-load="autoLoad"
|
|
9
|
+
:columns="columns"
|
|
10
|
+
:show-checkbox="editable"
|
|
11
|
+
:is-edit="editable"
|
|
12
|
+
:edit-rules="editRules"
|
|
13
|
+
:left-buttons="['ADD_FEE']"
|
|
14
|
+
:service-config="serviceConfig"
|
|
15
|
+
:transform-params="transformParams"
|
|
16
|
+
:virtual-x-config="{ enabled: false }"
|
|
17
|
+
:virtual-y-config="{ enabled: false }"
|
|
18
|
+
:checkbox-config="{
|
|
19
|
+
visibleMethod: ({ row }) => !(diffable && row.diffable),
|
|
20
|
+
checkMethod: ({ row }) => !(diffable && row.diffable),
|
|
21
|
+
}"
|
|
22
|
+
:before-edit-method="({ row }) => editable && !(diffable && row.diffable)"
|
|
23
|
+
min-height="179px"
|
|
24
|
+
max-height="403px"
|
|
25
|
+
v-on="gridEvents"
|
|
26
|
+
>
|
|
27
|
+
<template v-for="column in columns" #[column.slots.default]="{ row }">
|
|
28
|
+
<span v-if="column.editRender?.name === 'tableSelect'" :key="`${column.field}-tableSelect`" :class="diffable && row.diffable && row[`${column.field}__diffable`] && 'text-red-500 line-through'">{{ getCodeSetTextByCode(column.editRender?.props?.codeSet, row[column.field]) }}</span>
|
|
29
|
+
<span v-else-if="column.formatter" :key="`${column.field}-formatter`" :class="diffable && row.diffable && row[`${column.field}__diffable`] && 'text-red-500 line-through'">{{ column.formatter({ row, cellValue: row[column.field] }) }}</span>
|
|
30
|
+
<span v-else :key="`${column.field}`" :class="diffable && row.diffable && row[`${column.field}__diffable`] && 'text-red-500 line-through'">{{ row[column.field] }}</span>
|
|
31
|
+
</template>
|
|
32
|
+
</VxePlusTable>
|
|
33
|
+
</BxContainer>
|
|
34
|
+
</BxRoundedContainer>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script setup lang="ts">
|
|
38
|
+
import { computed, inject, nextTick, reactive, ref, watch } from 'vue'
|
|
39
|
+
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
40
|
+
import { createTableColumns } from './columns'
|
|
41
|
+
import { createEiBlock, sendService } from '@/utils/eiTools'
|
|
42
|
+
import { isEmpty } from '@/utils/is'
|
|
43
|
+
import { useCodeSetStore } from '@/stores/modules/codeSet'
|
|
44
|
+
|
|
45
|
+
const xGrid = ref<any>(null)
|
|
46
|
+
|
|
47
|
+
const { detailInfo, businessType, diffable, pageId } = inject('__PMPC0101__info__') as any
|
|
48
|
+
|
|
49
|
+
const { getId } = inject('__PMPC0101__method__') as any
|
|
50
|
+
|
|
51
|
+
const { columns, editRules, tableValidator } = createTableColumns() as any
|
|
52
|
+
|
|
53
|
+
const { getCodeSetTextByCode } = useCodeSetStore()
|
|
54
|
+
|
|
55
|
+
const autoLoad = computed(() => !!detailInfo.value[getId('pcContractMainId')])
|
|
56
|
+
|
|
57
|
+
const editable = computed(() => {
|
|
58
|
+
if (detailInfo.value.pcContractMainId) {
|
|
59
|
+
return ['10', '12', '15', '20', '30', '40'].includes(detailInfo.value.contractStatus)
|
|
60
|
+
}
|
|
61
|
+
return true
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
const tablePageId = computed(() => `${pageId.value}_result_3`)
|
|
65
|
+
|
|
66
|
+
function getTableData() {
|
|
67
|
+
const $grid = xGrid.value.getGridInstance()
|
|
68
|
+
const { tableData } = $grid.getTableData()
|
|
69
|
+
if (diffable.value) {
|
|
70
|
+
return tableData.filter(row => !row.diffable)
|
|
71
|
+
}
|
|
72
|
+
return tableData
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async function handleValidator(flag?) {
|
|
76
|
+
try {
|
|
77
|
+
await tableValidator(xGrid, flag ?? diffable.value ? getTableData() : true)
|
|
78
|
+
return Promise.resolve(true)
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
return Promise.reject(error)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function reload() {
|
|
86
|
+
xGrid.value.reload()
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const serviceConfig = reactive({
|
|
90
|
+
serviceName: 'PMPC0101',
|
|
91
|
+
queryMethod: 'queryContractFee',
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
function transformParams(formEi) {
|
|
95
|
+
formEi.set(`inqu_status-0-pcContractMainId`, detailInfo.value.pcContractMainId)
|
|
96
|
+
return formEi
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const gridEvents = reactive({
|
|
100
|
+
toolbarButtonClick: ({ code, $grid }) => {
|
|
101
|
+
switch (code) {
|
|
102
|
+
case 'ADD_FEE':
|
|
103
|
+
handleAdd($grid)
|
|
104
|
+
break
|
|
105
|
+
case 'DELETE_FEE':
|
|
106
|
+
handleDelete($grid)
|
|
107
|
+
break
|
|
108
|
+
case 'SAVE_FEE':
|
|
109
|
+
handleSave()
|
|
110
|
+
break
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
// 新增操作
|
|
116
|
+
async function handleAdd($grid) {
|
|
117
|
+
if (!detailInfo.value[getId('pcContractMainId')]) {
|
|
118
|
+
return ElMessage.warning('请先保存合同信息!')
|
|
119
|
+
}
|
|
120
|
+
const checkedRows = [
|
|
121
|
+
{
|
|
122
|
+
[getId('pcContractFeeId')]: '',
|
|
123
|
+
feeTypeName: '',
|
|
124
|
+
cgFeeTypeCode: '',
|
|
125
|
+
feePayer: '',
|
|
126
|
+
feeContractCode: '',
|
|
127
|
+
feeContractId: '',
|
|
128
|
+
remark: '',
|
|
129
|
+
},
|
|
130
|
+
]
|
|
131
|
+
const { rows: newRows } = await $grid.insertAt(checkedRows)
|
|
132
|
+
$grid.setEditRow(newRows[newRows.length - 1])
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// 删除
|
|
136
|
+
async function handleDelete($grid) {
|
|
137
|
+
if (!detailInfo.value[getId('pcContractMainId')]) {
|
|
138
|
+
return ElMessage.warning('请先保存合同信息!')
|
|
139
|
+
}
|
|
140
|
+
const checkboxRecords = $grid.getCheckboxRecords()
|
|
141
|
+
if (!checkboxRecords.length) {
|
|
142
|
+
ElMessage.warning(`请选中一条数据`)
|
|
143
|
+
return
|
|
144
|
+
}
|
|
145
|
+
try {
|
|
146
|
+
await ElMessageBox.confirm(`确定要删除吗?`)
|
|
147
|
+
const rows = checkboxRecords.filter((row) => {
|
|
148
|
+
return !isEmpty(row[getId('pcContractFeeId')])
|
|
149
|
+
})
|
|
150
|
+
if (rows.length) {
|
|
151
|
+
await sendService({
|
|
152
|
+
serviceName: 'PMPC9903',
|
|
153
|
+
methodName: 'deleteGric',
|
|
154
|
+
eiBlocks: [
|
|
155
|
+
createEiBlock(rows.map((item) => {
|
|
156
|
+
return {
|
|
157
|
+
[getId('pcContractFeeId')]: item[getId('pcContractFeeId')],
|
|
158
|
+
}
|
|
159
|
+
}), 'result_3'),
|
|
160
|
+
createEiBlock({
|
|
161
|
+
[getId('pcContractMainId')]: detailInfo.value[getId('pcContractMainId')],
|
|
162
|
+
businessType: businessType.value,
|
|
163
|
+
}, 'inqu_status'),
|
|
164
|
+
],
|
|
165
|
+
})
|
|
166
|
+
ElMessage.success('删除成功')
|
|
167
|
+
reload()
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
$grid.removeCheckboxRow()
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// 保存
|
|
179
|
+
async function handleSave() {
|
|
180
|
+
if (!detailInfo.value[getId('pcContractMainId')]) {
|
|
181
|
+
return ElMessage.warning('请先保存合同信息!')
|
|
182
|
+
}
|
|
183
|
+
const tableData = getTableData()
|
|
184
|
+
if (!tableData.length) {
|
|
185
|
+
return ElMessage.warning('至少需要1条明细数据')
|
|
186
|
+
}
|
|
187
|
+
try {
|
|
188
|
+
await handleValidator()
|
|
189
|
+
if (detailInfo.value.directFlag === 'Y') {
|
|
190
|
+
const rows = tableData.filter(row => row.feePayer === '10')
|
|
191
|
+
if (rows.length) {
|
|
192
|
+
await ElMessageBox.confirm(`合同为直发,【${rows.map(row => row.feeTypeName).join('、')}】费用选择了费用承担方为我方,是否确认保存?`)
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
await sendService({
|
|
196
|
+
serviceName: 'PMPC9903',
|
|
197
|
+
methodName: 'saveGric',
|
|
198
|
+
eiBlocks: [
|
|
199
|
+
createEiBlock(tableData.map((item) => {
|
|
200
|
+
return {
|
|
201
|
+
...item,
|
|
202
|
+
pcContractMainId: detailInfo.value.pcContractMainId,
|
|
203
|
+
[getId('pcContractMainId')]: detailInfo.value[getId('pcContractMainId')],
|
|
204
|
+
}
|
|
205
|
+
}), 'result_3'),
|
|
206
|
+
createEiBlock({
|
|
207
|
+
pcContractMainId: detailInfo.value.pcContractMainId,
|
|
208
|
+
[getId('pcContractMainId')]: detailInfo.value[getId('pcContractMainId')],
|
|
209
|
+
businessType: businessType.value,
|
|
210
|
+
}, 'inqu_status'),
|
|
211
|
+
],
|
|
212
|
+
})
|
|
213
|
+
ElMessage.success('保存成功')
|
|
214
|
+
reload()
|
|
215
|
+
}
|
|
216
|
+
catch {
|
|
217
|
+
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
watch(() => editable.value, () => {
|
|
222
|
+
nextTick(() => {
|
|
223
|
+
xGrid.value?.btnSetDisable(['ADD_FEE', 'DELETE_FEE', 'SAVE_FEE'], !editable.value)
|
|
224
|
+
})
|
|
225
|
+
}, {
|
|
226
|
+
immediate: true,
|
|
227
|
+
})
|
|
228
|
+
|
|
229
|
+
defineExpose({
|
|
230
|
+
reload,
|
|
231
|
+
validator: handleValidator,
|
|
232
|
+
})
|
|
233
|
+
</script>
|
|
234
|
+
|
|
235
|
+
<style scoped></style>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 谢力
|
|
3
|
+
* @Date: 2025-06-26 15:30:28
|
|
4
|
+
* @LastEditors: Please set LastEditors
|
|
5
|
+
* @LastEditTime: 2025-11-06 11:15:12
|
|
6
|
+
*/
|
|
7
|
+
import { computed } from 'vue'
|
|
8
|
+
import { useTable } from '@/hooks/useTable'
|
|
9
|
+
|
|
10
|
+
export function createTableColumns() {
|
|
11
|
+
const { createColumns, createEditRules, validator } = useTable()
|
|
12
|
+
|
|
13
|
+
const columns = computed(() => {
|
|
14
|
+
return createColumns([
|
|
15
|
+
{
|
|
16
|
+
field: 'fileId',
|
|
17
|
+
title: '附件Id',
|
|
18
|
+
visible: false,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
field: 'fileTypeCode',
|
|
22
|
+
title: '附件类型',
|
|
23
|
+
width: 300,
|
|
24
|
+
editRender: {
|
|
25
|
+
name: 'tableSelect',
|
|
26
|
+
props: {
|
|
27
|
+
tableBlockName: 'fileTypeList',
|
|
28
|
+
valueField: 'comItemCode',
|
|
29
|
+
textField: 'comItemName',
|
|
30
|
+
},
|
|
31
|
+
enabled: false,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
field: 'fileName',
|
|
36
|
+
title: '附件名称',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
title: '操作',
|
|
40
|
+
field: 'operation',
|
|
41
|
+
width: 130,
|
|
42
|
+
slots: {
|
|
43
|
+
default: 'operation_default',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
].map((col) => {
|
|
47
|
+
return {
|
|
48
|
+
...col,
|
|
49
|
+
width: (col as any).width ?? '',
|
|
50
|
+
} as any
|
|
51
|
+
})).value
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
const tableValidator = (...args: any[]) => {
|
|
55
|
+
return (validator as any)(...args)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
columns,
|
|
60
|
+
editRules: computed(() => createEditRules(columns.value)),
|
|
61
|
+
tableValidator,
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: 谢力
|
|
3
|
+
* @Date: 2025-09-07 18:14:08
|
|
4
|
+
* @LastEditors: Please set LastEditors
|
|
5
|
+
* @LastEditTime: 2025-11-24 14:17:22
|
|
6
|
+
-->
|
|
7
|
+
<template>
|
|
8
|
+
<BxRoundedContainer>
|
|
9
|
+
<BxContainer title="合同文本">
|
|
10
|
+
<VxePlusTable
|
|
11
|
+
id="FILES_result"
|
|
12
|
+
ref="xGrid"
|
|
13
|
+
class="pb0"
|
|
14
|
+
:auto-load="true"
|
|
15
|
+
:columns="columns"
|
|
16
|
+
:show-checkbox="false"
|
|
17
|
+
:is-edit="false"
|
|
18
|
+
:service-config="serviceConfig"
|
|
19
|
+
:transform-params="transformParams"
|
|
20
|
+
min-height="179px"
|
|
21
|
+
max-height="401px"
|
|
22
|
+
>
|
|
23
|
+
<template #operation_default="{ row }">
|
|
24
|
+
<div class="flex-row align-center">
|
|
25
|
+
<el-link v-if="row.fileId" type="primary" class="mr10" :underline="false" @click="handleDownload(row)">
|
|
26
|
+
下载
|
|
27
|
+
</el-link>
|
|
28
|
+
<el-link v-if="row.fileId" type="primary" :underline="false" @click="handleView(row)">
|
|
29
|
+
预览
|
|
30
|
+
</el-link>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
</VxePlusTable>
|
|
34
|
+
</BxContainer>
|
|
35
|
+
</BxRoundedContainer>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script setup lang="ts">
|
|
39
|
+
import { inject, reactive, ref } from 'vue'
|
|
40
|
+
import { Base64 } from 'js-base64'
|
|
41
|
+
import Qs from 'qs'
|
|
42
|
+
import { createTableColumns } from './columns'
|
|
43
|
+
import { downloadFile, openV6Page } from '@/utils'
|
|
44
|
+
import { isEmpty } from '@/utils/is'
|
|
45
|
+
|
|
46
|
+
const xGrid = ref<any>(null)
|
|
47
|
+
|
|
48
|
+
const { editable, detailInfo, isChange } = inject('__PMPC0101__info__') as any
|
|
49
|
+
|
|
50
|
+
const { columns } = createTableColumns() as any
|
|
51
|
+
|
|
52
|
+
const serviceConfig = reactive({
|
|
53
|
+
serviceName: 'BFSS0001',
|
|
54
|
+
queryMethod: 'query',
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
function transformParams(formEi) {
|
|
58
|
+
const bizTypeCode = editable.value ? (isChange.value ? 'PM_CONTRACT_PROPOSE' : 'PM_CONTRACT_CORRECT') : 'PM_CONTRACT_PROPOSE,PM_CONTRACT_FORMAL,PM_CONTRACT_CORRECT,PM_CONTRACT_END'
|
|
59
|
+
const operateFlag = editable.value ? 'operate' : 'view'
|
|
60
|
+
const bizBillId = detailInfo.value.pcContractMainId
|
|
61
|
+
const bizBillCode = detailInfo.value.pcContractCode
|
|
62
|
+
const bizBillVersion = detailInfo.value.contractVersion
|
|
63
|
+
const bookId = detailInfo.value.bookId
|
|
64
|
+
const verFlag = editable.value ? 'Y' : 'N'
|
|
65
|
+
const fileTypeCode = ''
|
|
66
|
+
const params = {
|
|
67
|
+
bizTypeCode,
|
|
68
|
+
fileTypeCode,
|
|
69
|
+
bizBillId,
|
|
70
|
+
bizBillCode,
|
|
71
|
+
contractId: bizBillId,
|
|
72
|
+
bizBillVersion,
|
|
73
|
+
operateFlag,
|
|
74
|
+
bookId,
|
|
75
|
+
} as any
|
|
76
|
+
if (!isEmpty(verFlag)) {
|
|
77
|
+
params.verFlag = verFlag
|
|
78
|
+
}
|
|
79
|
+
Object.keys(params).forEach((key) => {
|
|
80
|
+
formEi.set(`inqu_status-0-${key}`, params[key])
|
|
81
|
+
})
|
|
82
|
+
return formEi
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// 下载
|
|
86
|
+
function handleDownload(row) {
|
|
87
|
+
const path = ['/file/download', Qs.stringify({
|
|
88
|
+
fileId: row.fileId,
|
|
89
|
+
})].join('?')
|
|
90
|
+
downloadFile(`${import.meta.env.VITE_BRMS_URL}${path}`)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// 预览
|
|
94
|
+
function handleView(row) {
|
|
95
|
+
const previewUrl = new URL(`${import.meta.env.VITE_PREVIEW_ONLINE_URL}`)
|
|
96
|
+
const fileUrl = new URL(`${import.meta.env.VITE_BRMS_PREVIEW_URL}/file/download`)
|
|
97
|
+
fileUrl.searchParams.set('fileId', row.fileId)
|
|
98
|
+
fileUrl.searchParams.set('number', new Date().getTime().toString())
|
|
99
|
+
fileUrl.searchParams.set('fullfilename', row.fileName)
|
|
100
|
+
previewUrl.searchParams.set('url', Base64.encode(fileUrl.toString()))
|
|
101
|
+
if (/\.pdf$/i.test(row.fileName)) {
|
|
102
|
+
previewUrl.searchParams.set('officePreviewType', 'pdf')
|
|
103
|
+
}
|
|
104
|
+
console.log('fileUrl.toString(): ', fileUrl.toString())
|
|
105
|
+
openV6Page(previewUrl.toString())
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function reload() {
|
|
109
|
+
xGrid.value.reload()
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
defineExpose({
|
|
113
|
+
reload,
|
|
114
|
+
})
|
|
115
|
+
</script>
|
|
116
|
+
|
|
117
|
+
<style scoped></style>
|