baseline: 小军 WMS 二开代码原始快照(含 SynOABusiness.cs Debugger.Break)
This commit is contained in:
commit
c2b0e7be0d
6522 files changed
+3530643
No files matched your search
@@ -0,0 +1,133 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>金蝶CRM产品同步 - Gaussian</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body { font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; display: flex; justify-content: center; align-items: center; padding: 20px; }
|
||||
.container { background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2); width: 100%; max-width: 520px; overflow: hidden; }
|
||||
.header { background: linear-gradient(135deg, #1a73e8, #1557b0); color: #fff; padding: 28px 32px; text-align: center; }
|
||||
.header h1 { font-size: 22px; font-weight: 600; letter-spacing: 1px; }
|
||||
.header p { font-size: 13px; opacity: 0.85; margin-top: 6px; }
|
||||
.body { padding: 32px; }
|
||||
.form-group { margin-bottom: 24px; }
|
||||
.form-group label { display: block; font-size: 14px; font-weight: 600; color: #333; margin-bottom: 8px; }
|
||||
.form-group label .required { color: #e74c3c; margin-left: 2px; }
|
||||
.form-group input { width: 100%; height: 48px; padding: 0 16px; font-size: 15px; border: 2px solid #e0e0e0; border-radius: 8px; outline: none; transition: border-color 0.25s, box-shadow 0.25s; }
|
||||
.form-group input:focus { border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12); }
|
||||
.form-group input::placeholder { color: #bbb; }
|
||||
.api-hint { font-size: 12px; color: #999; margin-top: 4px; }
|
||||
.btn { width: 100%; height: 50px; font-size: 16px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #1a73e8, #1557b0); border: none; border-radius: 8px; cursor: pointer; letter-spacing: 1px; transition: opacity 0.2s, transform 0.1s; }
|
||||
.btn:hover { opacity: 0.92; }
|
||||
.btn:active { transform: scale(0.98); }
|
||||
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
|
||||
.result { margin-top: 24px; padding: 16px; border-radius: 8px; font-size: 14px; line-height: 1.7; display: none; word-break: break-all; white-space: pre-wrap; max-height: 400px; overflow-y: auto; }
|
||||
.result.success { display: block; background: #e6f9ed; border: 1px solid #a3e4bc; color: #1a7a3a; }
|
||||
.result.error { display: block; background: #fdeaea; border: 1px solid #f5b7b7; color: #b71c1c; }
|
||||
.result .icon { font-size: 18px; margin-right: 6px; }
|
||||
.history { margin-top: 28px; border-top: 1px solid #eee; padding-top: 20px; }
|
||||
.history h3 { font-size: 15px; color: #555; margin-bottom: 12px; }
|
||||
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #f8f9fa; border-radius: 6px; margin-bottom: 8px; font-size: 13px; cursor: pointer; transition: background 0.2s; }
|
||||
.history-item:hover { background: #e8f0fe; }
|
||||
.history-item .number { font-weight: 600; color: #1a73e8; }
|
||||
.history-item .status { padding: 2px 10px; border-radius: 12px; font-size: 12px; }
|
||||
.history-item .status.ok { background: #e6f9ed; color: #1a7a3a; }
|
||||
.history-item .status.fail { background: #fdeaea; color: #b71c1c; }
|
||||
.loading-spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle; margin-right: 8px; }
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
.footer { text-align: center; padding: 0 32px 28px; font-size: 12px; color: #aaa; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="position:fixed;top:0;left:0;right:0;background:linear-gradient(135deg, #1a73e8, #1557b0);color:#fff;padding:0 24px;display:flex;align-items:center;height:56px;box-shadow:0 2px 8px rgba(0,0,0,0.15);z-index:100;">
|
||||
<span style="font-size:18px;font-weight:600;margin-right:32px;">Gaussian</span>
|
||||
<div style="display:flex;gap:4px;height:100%;" id="navTabs"></div>
|
||||
<span style="margin-left:auto;font-size:13px;opacity:0.85;" id="userInfo"></span>
|
||||
</div>
|
||||
<div style="padding-top:56px;">
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1>金蝶CRM产品同步</h1>
|
||||
<p>调用 CrUpCrmProduct 接口同步物料数据</p>
|
||||
</div>
|
||||
<div class="body">
|
||||
<div class="form-group">
|
||||
<label>物料编码<span class="required">*</span></label>
|
||||
<input type="text" id="txtFMaNumber" placeholder="请输入物料编码,如:900000344" autocomplete="off" />
|
||||
<div class="api-hint">接口:POST /api/Differential/CrUpCrmProduct</div>
|
||||
</div>
|
||||
<button class="btn" id="btnSubmit" onclick="doSync()">开始同步</button>
|
||||
<div class="result" id="result"></div>
|
||||
<div class="history" id="history" style="display:none;">
|
||||
<h3>操作记录</h3>
|
||||
<div id="historyList"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">GXWebApi © 2026</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var HISTORY_KEY = 'gx_sync_history';
|
||||
function getHistory() { try { return JSON.parse(localStorage.getItem(HISTORY_KEY) || '[]'); } catch (e) { return []; } }
|
||||
function saveHistory(item) { var list = getHistory(); list.unshift(item); if (list.length > 10) list = list.slice(0, 10); localStorage.setItem(HISTORY_KEY, JSON.stringify(list)); renderHistory(); }
|
||||
function escapeHtml(str) { var div = document.createElement('div'); div.appendChild(document.createTextNode(str)); return div.innerHTML; }
|
||||
function renderHistory() {
|
||||
var list = getHistory(); var container = document.getElementById('historyList'); var wrap = document.getElementById('history');
|
||||
if (list.length === 0) { wrap.style.display = 'none'; return; }
|
||||
wrap.style.display = 'block'; var html = '';
|
||||
list.forEach(function (item) {
|
||||
var cls = item.success ? 'ok' : 'fail'; var txt = item.success ? '成功' : '失败';
|
||||
var msgHtml = item.message ? '<div style="font-size:11px;color:#999;margin-top:3px;">' + escapeHtml(item.message) + '</div>' : '';
|
||||
html += '<div class="history-item" onclick="fillNumber(\'' + item.number + '\')" style="display:block;cursor:pointer;">'
|
||||
+ '<div style="display:flex;justify-content:space-between;align-items:center;">'
|
||||
+ '<span class="number">' + item.number + '</span>'
|
||||
+ '<span style="color:#999;font-size:12px;">' + item.time + '</span>'
|
||||
+ '<span class="status ' + cls + '">' + txt + '</span></div>' + msgHtml + '</div>';
|
||||
});
|
||||
container.innerHTML = html;
|
||||
}
|
||||
function fillNumber(num) { document.getElementById('txtFMaNumber').value = num; }
|
||||
function showResult(success, message) { var el = document.getElementById('result'); el.className = 'result ' + (success ? 'success' : 'error'); el.innerHTML = '<span class="icon">' + (success ? '✓' : '✗') + '</span>' + message; }
|
||||
function hideResult() { var el = document.getElementById('result'); el.className = 'result'; el.style.display = 'none'; }
|
||||
function doSync() {
|
||||
var input = document.getElementById('txtFMaNumber'); var btn = document.getElementById('btnSubmit'); var FMaNumber = input.value.trim();
|
||||
if (!FMaNumber) { showResult(false, '请输入物料编码'); input.focus(); return; }
|
||||
hideResult(); btn.disabled = true; btn.innerHTML = '<span class="loading-spinner"></span>同步中...';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('POST', 'api/Differential/CrUpCrmProduct', true);
|
||||
xhr.setRequestHeader('Content-Type', 'application/json');
|
||||
xhr.timeout = 120000;
|
||||
xhr.onload = function () {
|
||||
btn.disabled = false; btn.innerHTML = '开始同步';
|
||||
try { var resp = JSON.parse(xhr.responseText); var success = resp.success === 'true' || resp.success === true; var msg = resp.message || (success ? '同步成功' : '同步失败'); showResult(success, msg); saveHistory({ number: FMaNumber, success: success, message: msg, time: new Date().toLocaleString('zh-CN', { hour12: false }) }); }
|
||||
catch (e) { var errMsg = '服务器返回异常:' + xhr.responseText.substring(0, 500); showResult(false, errMsg); saveHistory({ number: FMaNumber, success: false, message: errMsg, time: new Date().toLocaleString('zh-CN', { hour12: false }) }); }
|
||||
};
|
||||
xhr.onerror = function () { btn.disabled = false; btn.innerHTML = '开始同步'; showResult(false, '网络连接失败'); };
|
||||
xhr.ontimeout = function () { btn.disabled = false; btn.innerHTML = '开始同步'; showResult(false, '请求超时(2分钟)'); };
|
||||
xhr.send(JSON.stringify({ FMaNumber: FMaNumber }));
|
||||
}
|
||||
document.getElementById('txtFMaNumber').addEventListener('keydown', function (e) { if (e.key === 'Enter') { doSync(); } });
|
||||
function logout(){sessionStorage.removeItem('gx_user');window.location.href='login.html'}
|
||||
renderHistory();
|
||||
|
||||
// ===== 登录校验 =====
|
||||
(function(){
|
||||
var userData=sessionStorage.getItem('gx_user');
|
||||
if(!userData){window.location.href='login.html';return}
|
||||
try{
|
||||
var user=JSON.parse(userData);
|
||||
var roles=user.roleNumbers||[];
|
||||
if(roles.indexOf('CRM01')<0){alert('当前用户无权限');sessionStorage.removeItem('gx_user');window.location.href='login.html';return}
|
||||
|
||||
var nav='<a href="index.html" style="color:#fff;text-decoration:none;padding:0 20px;display:flex;align-items:center;background:rgba(255,255,255,0.2);border-radius:4px 4px 0 0;font-size:14px;">CRM产品同步</a>';
|
||||
if(roles.indexOf('Purchase01')>=0)nav+='<a href="procurement.html" style="color:rgba(255,255,255,0.75);text-decoration:none;padding:0 20px;display:flex;align-items:center;font-size:14px;">采购申请管理</a>';
|
||||
if(roles.indexOf('YF01')>=0)nav+='<a href="dashboard.html" style="color:rgba(255,255,255,0.75);text-decoration:none;padding:0 20px;display:flex;align-items:center;font-size:14px;">研发采购看板</a>';
|
||||
document.getElementById('navTabs').innerHTML=nav;
|
||||
document.getElementById('userInfo').innerHTML=(user.userName||user.userId)+' | <a href="javascript:void(0)" onclick="logout()" style="color:#fff;text-decoration:none;margin-left:8px;font-size:12px;">退出</a>';
|
||||
}catch(e){alert('当前用户无权限');window.location.href='login.html'}
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user