钉钉审批功能完善、混炼示方新增是否附加料
This commit is contained in:
@@ -105,6 +105,10 @@
|
||||
<DingApprovalLaunchModal ref="launchModalRef" @success="handleLaunchSuccess" />
|
||||
<!--update-end---author:GHT ---date:2026-06-03 for:【MESToDing审批配置】手动填表发起钉钉审批-->
|
||||
|
||||
<!--update-begin---author:GHT ---date:20260610 for:【MESToDing审批配置】操作列绑定审批流程-->
|
||||
<BindApprovalFlowModal ref="bindFlowModalRef" @success="handleSuccess" />
|
||||
<!--update-end---author:GHT ---date:20260610 for:【MESToDing审批配置】操作列绑定审批流程-->
|
||||
|
||||
<!--update-begin---author:GHT ---date:2026-06-03 for:【MESToDing审批配置】钉钉同步结果弹窗-->
|
||||
<a-modal
|
||||
v-model:open="syncVisible"
|
||||
@@ -154,8 +158,11 @@
|
||||
//update-begin---author:GHT ---date:2026-06-03 for:【MESToDing审批配置】手动填表发起钉钉审批
|
||||
import DingApprovalLaunchModal from './components/DingApprovalLaunchModal.vue';
|
||||
//update-end---author:GHT ---date:2026-06-03 for:【MESToDing审批配置】手动填表发起钉钉审批
|
||||
//update-begin---author:GHT ---date:20260610 for:【MESToDing审批配置】操作列绑定审批流程
|
||||
import BindApprovalFlowModal from './components/BindApprovalFlowModal.vue';
|
||||
//update-end---author:GHT ---date:20260610 for:【MESToDing审批配置】操作列绑定审批流程
|
||||
import { columns, searchFormSchema, superQuerySchema } from './MesXslDingProcessTpl.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, syncFromDingtalk, batchImport, getTemplateDetail } from './MesXslDingProcessTpl.api';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, syncFromDingtalk, batchImport, getTemplateDetail, toggleTplStatus } from './MesXslDingProcessTpl.api';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const queryParam = reactive<any>({});
|
||||
@@ -167,6 +174,9 @@
|
||||
api: list,
|
||||
columns,
|
||||
canResize: true,
|
||||
//update-begin---author:GHT ---date:2026-06-10 for:【钉钉审批模板】操作列加宽避免按钮挤压-----------
|
||||
scroll: { x: 1700 },
|
||||
//update-end---author:GHT ---date:2026-06-10 for:【钉钉审批模板】操作列加宽避免按钮挤压-----------
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
@@ -175,7 +185,9 @@
|
||||
actionColumn: {
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 220,
|
||||
//update-begin---author:GHT ---date:2026-06-10 for:【钉钉审批模板】操作列加宽避免按钮挤压-----------
|
||||
width: 540,
|
||||
//update-end---author:GHT ---date:2026-06-10 for:【钉钉审批模板】操作列加宽避免按钮挤压-----------
|
||||
fixed: 'right',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
@@ -230,27 +242,72 @@
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
function isTplEnabled(record: Recordable) {
|
||||
return record.status === '1' || record.status === 1;
|
||||
}
|
||||
|
||||
async function handleToggleStatus(record: Recordable) {
|
||||
try {
|
||||
const msg = await toggleTplStatus(record.id);
|
||||
createMessage.success(typeof msg === 'string' ? msg : isTplEnabled(record) ? '已停用' : '已启用');
|
||||
reload();
|
||||
} catch (e: any) {
|
||||
createMessage.error(e?.message || '操作失败');
|
||||
}
|
||||
}
|
||||
|
||||
function getTableAction(record) {
|
||||
const enabled = isTplEnabled(record);
|
||||
return [
|
||||
{ label: '编辑', onClick: handleEdit.bind(null, record), auth: 'xslmes:mes_xsl_ding_process_tpl:edit' },
|
||||
//update-begin---author:GHT ---date:2026-06-03 for:【MESToDing审批配置】操作列新增发起审批按钮
|
||||
//update-begin---author:GHT ---date:20260610 for:【钉钉审批模板】操作列停用/启用-----------
|
||||
{
|
||||
label: '发起审批',
|
||||
label: enabled ? '停用' : '启用',
|
||||
color: enabled ? 'warning' : 'success',
|
||||
auth: 'xslmes:mes_xsl_ding_process_tpl:edit',
|
||||
popConfirm: {
|
||||
title: enabled
|
||||
? '停用后,已绑定该模板的业务页面将不再显示「钉钉审批」按钮,确认停用?'
|
||||
: '确认启用该审批模板?启用后业务页将恢复显示钉钉审批按钮。',
|
||||
confirm: handleToggleStatus.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
},
|
||||
//update-end---author:GHT ---date:20260610 for:【钉钉审批模板】操作列停用/启用-----------
|
||||
//update-begin---author:GHT ---date:20260610 for:【MESToDing审批配置】操作列绑定审批流程
|
||||
{
|
||||
label: '绑定审批流程',
|
||||
icon: 'ant-design:apartment-outlined',
|
||||
auth: 'xslmes:mes_xsl_ding_process_tpl:edit',
|
||||
onClick: handleBindApprovalFlow.bind(null, record),
|
||||
},
|
||||
//update-end---author:GHT ---date:20260610 for:【MESToDing审批配置】操作列绑定审批流程
|
||||
//update-begin---author:GHT ---date:2026-06-10 for:【MESToDing审批配置】设计模板移至操作列、发起审批改名为测试审批
|
||||
{
|
||||
label: '设计模板',
|
||||
icon: 'ant-design:layout-outlined',
|
||||
auth: 'xslmes:mes_xsl_ding_process_tpl:edit',
|
||||
onClick: handleDesignTemplate.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '测试审批',
|
||||
icon: 'ant-design:send-outlined',
|
||||
color: 'success',
|
||||
disabled: !record.processCode,
|
||||
tooltip: record.processCode ? '手动填表后发起钉钉审批' : '请先配置 processCode',
|
||||
disabled: !enabled || !record.processCode,
|
||||
tooltip: !enabled
|
||||
? '模板已停用'
|
||||
: record.processCode
|
||||
? '手动填表后测试发起钉钉审批'
|
||||
: '请先配置 processCode',
|
||||
onClick: handleLaunchApproval.bind(null, record),
|
||||
},
|
||||
//update-end---author:GHT ---date:2026-06-03 for:【MESToDing审批配置】操作列新增发起审批按钮
|
||||
//update-end---author:GHT ---date:2026-06-10 for:【MESToDing审批配置】设计模板移至操作列、发起审批改名为测试审批
|
||||
];
|
||||
}
|
||||
|
||||
function getDropDownAction(record) {
|
||||
const actions: any[] = [
|
||||
{ label: '详情', onClick: handleDetail.bind(null, record) },
|
||||
//update-begin---author:GHT ---date:2026-06-03 for:【MESToDing审批配置】新增设计模板入口
|
||||
{ label: '设计模板', onClick: handleDesignTemplate.bind(null, record), icon: 'ant-design:layout-outlined' },
|
||||
];
|
||||
if (!record.processCode) {
|
||||
actions.push({
|
||||
@@ -262,7 +319,6 @@
|
||||
}
|
||||
actions.push(
|
||||
{ label: '查看钉钉字段', onClick: handleShowDingSchema.bind(null, record), icon: 'ant-design:dingtalk-outlined' },
|
||||
//update-end---author:GHT ---date:2026-06-03 for:【MESToDing审批配置】新增设计模板入口
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record), placement: 'topLeft' },
|
||||
@@ -272,11 +328,24 @@
|
||||
return actions;
|
||||
}
|
||||
|
||||
// ===== 绑定审批流程 =====
|
||||
//update-begin---author:GHT ---date:20260610 for:【MESToDing审批配置】操作列绑定审批流程
|
||||
const bindFlowModalRef = ref();
|
||||
|
||||
function handleBindApprovalFlow(record: Recordable) {
|
||||
bindFlowModalRef.value?.open(record);
|
||||
}
|
||||
//update-end---author:GHT ---date:20260610 for:【MESToDing审批配置】操作列绑定审批流程
|
||||
|
||||
// ===== 手动填表发起钉钉审批 =====
|
||||
//update-begin---author:GHT ---date:2026-06-03 for:【MESToDing审批配置】手动填表发起钉钉审批
|
||||
const launchModalRef = ref();
|
||||
|
||||
function handleLaunchApproval(record: Recordable) {
|
||||
if (!isTplEnabled(record)) {
|
||||
createMessage.warning('该模板已停用,请先启用后再发起审批');
|
||||
return;
|
||||
}
|
||||
if (!record.processCode) {
|
||||
createMessage.warning('该模板尚未配置 processCode,请先完成模板配置');
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user