|
@@ -146,7 +146,17 @@
|
|
|
import LaunchProcess from '/@/views/workflow/task/components/LaunchProcess.vue';
|
|
|
import ApprovalProcess from '/@/views/workflow/task/components/ApprovalProcess.vue';
|
|
|
import { downloadByData } from '/@/utils/file/download';
|
|
|
- import { onMounted, ref, unref, computed, createVNode, provide, reactive, UnwrapRef } from 'vue';
|
|
|
+ import {
|
|
|
+ onMounted,
|
|
|
+ ref,
|
|
|
+ unref,
|
|
|
+ computed,
|
|
|
+ createVNode,
|
|
|
+ provide,
|
|
|
+ reactive,
|
|
|
+ UnwrapRef,
|
|
|
+ Ref,
|
|
|
+ } from 'vue';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import { getFormTemplate } from '/@/api/form/design';
|
|
|
import { getFormRelease } from '/@/api/form/release';
|
|
@@ -183,6 +193,7 @@
|
|
|
import { PrintButton } from '/@/enums/printEnum';
|
|
|
import { InputParamItem } from '/@/components/ApiConfig/src/interface';
|
|
|
import { getDraftInfo } from '/@/api/workflow/process';
|
|
|
+ import { putLedgerLedgerCustom } from '/@/services/apis/LedgerCustomController';
|
|
|
interface SearchDate {
|
|
|
fieldName: string;
|
|
|
format: string;
|
|
@@ -213,7 +224,8 @@
|
|
|
formType = ref<string>(''), //弹窗类型:modal、drawer
|
|
|
formWidth = ref<number>(800), // 弹窗、抽屉宽度
|
|
|
menuId = ref<string>(''),
|
|
|
- pkField = ref<string>(''); //主表主键
|
|
|
+ pkField = ref<string>(''), //主表主键
|
|
|
+ pkTable = ref<string>(''); //主表
|
|
|
const subFormConfig = ref<any>([]);
|
|
|
// 模板打印 入参参数
|
|
|
let printData: {
|
|
@@ -228,7 +240,14 @@
|
|
|
requestBodyConfigs: [],
|
|
|
});
|
|
|
//展示在列表内的按钮
|
|
|
- const actionButtons = ref<string[]>(['view', 'edit', 'copyData', 'delete', 'startwork']);
|
|
|
+ const actionButtons = ref<string[]>([
|
|
|
+ 'view',
|
|
|
+ 'edit',
|
|
|
+ 'copyData',
|
|
|
+ 'delete',
|
|
|
+ 'startwork',
|
|
|
+ 'enabled',
|
|
|
+ ]);
|
|
|
const { notification } = useMessage();
|
|
|
const { t } = useI18n();
|
|
|
defineEmits(['register']);
|
|
@@ -303,6 +322,7 @@
|
|
|
export: handleExport,
|
|
|
print: handlePrint,
|
|
|
copyData: handleCopyData,
|
|
|
+ enabled: handleEnabled,
|
|
|
};
|
|
|
|
|
|
const fieldNames = computed(() => {
|
|
@@ -390,6 +410,11 @@
|
|
|
};
|
|
|
};
|
|
|
}
|
|
|
+ if (column.dataIndex === 'enabled_mark') {
|
|
|
+ column.customRender = ({ text }) => {
|
|
|
+ return text === 1 ? '启用' : '停用';
|
|
|
+ };
|
|
|
+ }
|
|
|
});
|
|
|
setColumns(filterColumns.value);
|
|
|
},
|
|
@@ -571,6 +596,17 @@
|
|
|
deleteList([record[pkField.value]]);
|
|
|
}
|
|
|
|
|
|
+ async function handleEnabled(record: Recordable) {
|
|
|
+ if (pkTable.value) {
|
|
|
+ await putLedgerLedgerCustom({
|
|
|
+ id: record[pkField.value],
|
|
|
+ tableName: pkTable.value,
|
|
|
+ enabledMark: record['enabled_mark'] === 1 ? 0 : 1,
|
|
|
+ });
|
|
|
+ reload();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
async function handlePrint() {
|
|
|
const dataSource = Array.isArray(getRawDataSource())
|
|
|
? getRawDataSource()
|
|
@@ -766,6 +802,7 @@
|
|
|
|
|
|
const mainTable = formJson.tableConfigs?.find((item) => item.isMain);
|
|
|
pkField.value = mainTable?.pkField || 'id';
|
|
|
+ pkTable.value = mainTable?.tableName || '';
|
|
|
|
|
|
//构建表单Props
|
|
|
formProps = buildOption(formJson.formJson, false);
|
|
@@ -838,6 +875,7 @@
|
|
|
onClick: handleView.bind(null, record),
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
if (['edit', 'copyData', 'delete'].includes(button.code)) {
|
|
|
editAndDelBtn.push({
|
|
|
icon: button?.icon,
|
|
@@ -885,6 +923,7 @@
|
|
|
icon: button?.icon,
|
|
|
tooltip: button?.name,
|
|
|
color: button.code === 'delete' ? 'error' : undefined,
|
|
|
+ disabled: button.code === 'enabled' && record['enabled_mark'] === 0,
|
|
|
onClick: btnEvent[button.code].bind(null, record),
|
|
|
};
|
|
|
}) || [];
|