MENU

[泛微Ecology10] 丸子的 E10 小本本

• 2025 年 11 月 14 日 • 阅读: 1433 • OA

  1. 检查表单在打开后数据是否存在变更:
window.WeaForm.getDataStatus();
  1. 无刷(静默)保存:formSdk.weFormApi.formStore.submitFormData();
  2. 获取整个表单数据: formSdk.weFormApi.formStore.getFormData().dataDetails;
  3. 图片上传字段单图片上传样式优化(最新版本:10.0.2512.01基线做了该优化处理):
.ui-upload-line-of-row > div:nth-child(1):nth-last-child(2) {
  display: none !important ;
}

.ui-upload:has(.ui-upload-listT) .ui-upload-select-image {
  display: none !important;
}
优化前优化后
image.pngimage.png
  1. ESB调用
const ebSdk=window.ebuilderSDK;
ebSdk.callEsbFlow("1991410702295896092",{dept:"taet"},[]).then(res=>{/*动作流回调逻辑*/});
// 1. 构造请求参数
const requestData = {
    customParams: {
        mainTable: {
            requestId: requestId
        }
    },
    esbFlowId: "1981608218199199750"
};

// 2. 发送POST请求到ESB接口
fetch('/api/esb/server/event/triggerActionFlow', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify(requestData)
})
.then((response) => {
    // 3. 解析响应JSON(捕获HTTP错误状态)
    if (!response.ok) {
        throw new Error(`HTTP错误!状态码:${response.status}`);
    }
    return response.json();
})
.then((data) => {
    // 4. 请求成功回调
    console.log('ESB流程触发成功:', data);
    // wffpSdk.showMessage('触发流程成功', 1, 3); // 成功提示(按需启用)
})
.catch((error) => {
    // 5. 异常捕获(网络错误/HTTP错误/解析错误)
    console.error('ESB流程触发失败:', error);
    wffpSdk.showMessage('触发刷新合同失败', 2, 3); // 失败提示
});
  1. 下拉字段显示值 键值关系 表单自定义字段选项表 field_option
  2. 自定义弹窗
    image.png
weappUi.Dialog.confirm({
    title: 'Notification',
    content: React.createElement('div', { style: { lineHeight: '1.6' } },
        React.createElement('div', { style: { fontWeight: 'bold' } }, 'Your template has been applied successfully.'),
        React.createElement('div', { style: { marginTop: '8px' } }, 'Please go to the Edit or View (Letter to Approve) page to edit your letter content.'),
        React.createElement('div', { style: { marginTop: '12px', fontSize: '12px', color: '#666', borderTop: '1px dashed #eee', paddingTop: '8px' } }, 
            'Note: If an incorrect template was selected, click [Generate Letter] to re-apply.'
        )
    ),
    icon: 'Icon-correct02-mcolor',
    cancelText: 'Got it',
    hideOkBtn: true,
    onCancel: () => console.log('Acknowledged')
});
最后编辑于: 2026 年 04 月 17 日