|
@@ -750,10 +750,8 @@ function operatorDayOptions(sel) {
|
|
|
return `<option value="">跟随系统默认(${db.setting.defaultReconcileDay} 日)</option>` +
|
|
return `<option value="">跟随系统默认(${db.setting.defaultReconcileDay} 日)</option>` +
|
|
|
Array.from({ length: 28 }, (_, k) => k + 1).map((d) => `<option value="${d}" ${d === sel ? "selected" : ""}>每月 ${d} 日</option>`).join("");
|
|
Array.from({ length: 28 }, (_, k) => k + 1).map((d) => `<option value="${d}" ${d === sel ? "selected" : ""}>每月 ${d} 日</option>`).join("");
|
|
|
}
|
|
}
|
|
|
-const PAY_CYCLES = [
|
|
|
|
|
- "合同生效次月起付款,与是否已向客户收妥无关",
|
|
|
|
|
- "按 ICT 合同,可为年、半年或季度",
|
|
|
|
|
-];
|
|
|
|
|
|
|
+/* 付款周期按合同约定,只记录不触发扣款,取值固定为按月 / 按季度 / 按年 */
|
|
|
|
|
+const PAY_CYCLES = ["按月", "按季度", "按年"];
|
|
|
|
|
|
|
|
/* 删除保护:返回阻塞原因数组 */
|
|
/* 删除保护:返回阻塞原因数组 */
|
|
|
function operatorDeleteBlocked(i) {
|
|
function operatorDeleteBlocked(i) {
|
|
@@ -886,7 +884,8 @@ function parseAcct(v) {
|
|
|
return { type: v.slice(0, k), index: Number(v.slice(k + 1)) };
|
|
return { type: v.slice(0, k), index: Number(v.slice(k + 1)) };
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* 账号主体:统一取主体名称、用途说明、默认登录名与对应的登录账号行(无行即未开通) */
|
|
|
|
|
|
|
+/* 账号主体:统一取主体名称、用途说明与对应的登录账号行(无行即未开通)。
|
|
|
|
|
+ 未开通时的登录名不预填,由开通人在弹窗里填写。 */
|
|
|
function acctSubject(t) {
|
|
function acctSubject(t) {
|
|
|
if (t.type === "operator") {
|
|
if (t.type === "operator") {
|
|
|
const o = db.operators[t.index] || { name: "—", notify: "" };
|
|
const o = db.operators[t.index] || { name: "—", notify: "" };
|
|
@@ -894,7 +893,6 @@ function acctSubject(t) {
|
|
|
label: o.name,
|
|
label: o.name,
|
|
|
kindName: "运营商对账账号",
|
|
kindName: "运营商对账账号",
|
|
|
usage: "对账查看账号(只读):登录后只能查看本方对账日、结算批次与账单,不能修改任何数据",
|
|
usage: "对账查看账号(只读):登录后只能查看本方对账日、结算批次与账单,不能修改任何数据",
|
|
|
- loginDefault: o.notify || "",
|
|
|
|
|
acc: db.users.find((u) => u.role === "operator" && u.operator === t.index) || null,
|
|
acc: db.users.find((u) => u.role === "operator" && u.operator === t.index) || null,
|
|
|
deny: `区域运营只能管理负责范围内的运营商账号,「${o.name}」不在您的负责范围内。`,
|
|
deny: `区域运营只能管理负责范围内的运营商账号,「${o.name}」不在您的负责范围内。`,
|
|
|
};
|
|
};
|
|
@@ -906,7 +904,6 @@ function acctSubject(t) {
|
|
|
label: `${team.name} · ${cur.name}`,
|
|
label: `${team.name} · ${cur.name}`,
|
|
|
kindName: "运营团队成员账号",
|
|
kindName: "运营团队成员账号",
|
|
|
usage: "运营团队账号:功能等同总运营,但只能在团队负责范围内操作",
|
|
usage: "运营团队账号:功能等同总运营,但只能在团队负责范围内操作",
|
|
|
- loginDefault: "",
|
|
|
|
|
acc: cur.login ? cur : null,
|
|
acc: cur.login ? cur : null,
|
|
|
row: cur,
|
|
row: cur,
|
|
|
deny: "区域运营只能管理本运营团队的成员账号,其他团队的成员账号不可管理。",
|
|
deny: "区域运营只能管理本运营团队的成员账号,其他团队的成员账号不可管理。",
|
|
@@ -918,7 +915,6 @@ function acctSubject(t) {
|
|
|
label: `${team.name} · 团队主账号`,
|
|
label: `${team.name} · 团队主账号`,
|
|
|
kindName: "运维团队主账号",
|
|
kindName: "运维团队主账号",
|
|
|
usage: "运维团队主账号:在团队负责范围内分派工单、给成员划负责范围",
|
|
usage: "运维团队主账号:在团队负责范围内分派工单、给成员划负责范围",
|
|
|
- loginDefault: "",
|
|
|
|
|
acc: db.users.find((u) => u.role === "teamLead" && u.team === t.index) || null,
|
|
acc: db.users.find((u) => u.role === "teamLead" && u.team === t.index) || null,
|
|
|
deny: `区域运营只能管理负责范围内的运维团队账号,「${team.name}」不在您的负责范围内。`,
|
|
deny: `区域运营只能管理负责范围内的运维团队账号,「${team.name}」不在您的负责范围内。`,
|
|
|
};
|
|
};
|
|
@@ -929,7 +925,6 @@ function acctSubject(t) {
|
|
|
label: `${team.name} · ${mem.name}`,
|
|
label: `${team.name} · ${mem.name}`,
|
|
|
kindName: "运维子账号",
|
|
kindName: "运维子账号",
|
|
|
usage: `${mem.type}子账号:${mem.type === "录入" ? "代录企业资料,不接单、不执行开停" : "在团队负责范围内接单与回填"}`,
|
|
usage: `${mem.type}子账号:${mem.type === "录入" ? "代录企业资料,不接单、不执行开停" : "在团队负责范围内接单与回填"}`,
|
|
|
- loginDefault: "",
|
|
|
|
|
acc: db.users.find((u) => u.member === t.index && u.role !== "teamLead") || null,
|
|
acc: db.users.find((u) => u.member === t.index && u.role !== "teamLead") || null,
|
|
|
deny: `区域运营只能管理负责范围内的运维团队账号,「${team.name}」不在您的负责范围内。`,
|
|
deny: `区域运营只能管理负责范围内的运维团队账号,「${team.name}」不在您的负责范围内。`,
|
|
|
};
|
|
};
|
|
@@ -1220,7 +1215,7 @@ function regionDrill(ctx) {
|
|
|
const c = underIdx.filter((ei) => db.enterprises[ei].operator === i).length;
|
|
const c = underIdx.filter((ei) => db.enterprises[ei].operator === i).length;
|
|
|
const day = o.reconcileDay === null || o.reconcileDay === undefined ? `跟随默认(${db.setting.defaultReconcileDay})` : `每月 ${o.reconcileDay} 日`;
|
|
const day = o.reconcileDay === null || o.reconcileDay === undefined ? `跟随默认(${db.setting.defaultReconcileDay})` : `每月 ${o.reconcileDay} 日`;
|
|
|
const ops = `${canAdmin ? `<button class="btn ghost" data-op-edit="${i}">编辑</button> <button class="btn ghost danger" data-op-del="${i}">删除</button>` : ""} ${acctBtn({ type: "operator", index: i })}`;
|
|
const ops = `${canAdmin ? `<button class="btn ghost" data-op-edit="${i}">编辑</button> <button class="btn ghost danger" data-op-del="${i}">删除</button>` : ""} ${acctBtn({ type: "operator", index: i })}`;
|
|
|
- return `<tr><td>${esc(o.name)}<br><span class="note">${acctStatusOf(acctSubject({ type: "operator", index: i }).acc)}</span></td><td>${day}</td><td class="wrap">${esc(o.payCycle)}</td><td>${esc(o.notify) || "—"}</td><td>${c}</td><td>${ops}</td></tr>`;
|
|
|
|
|
|
|
+ return `<tr><td>${esc(o.name)}<br><span class="note">${acctStatusOf(acctSubject({ type: "operator", index: i }).acc)}</span></td><td>${day}</td><td>${esc(o.payCycle)}</td><td>${esc(o.notify) || "—"}</td><td>${c}</td><td>${ops}</td></tr>`;
|
|
|
}).join("");
|
|
}).join("");
|
|
|
return `<div class="panel">
|
|
return `<div class="panel">
|
|
|
<div class="row" style="justify-content:space-between;align-items:center">
|
|
<div class="row" style="justify-content:space-between;align-items:center">
|
|
@@ -1495,7 +1490,7 @@ function modalHtml() {
|
|
|
</div>`;
|
|
</div>`;
|
|
|
if (!acc) {
|
|
if (!acc) {
|
|
|
body = `<p class="note">为「${esc(s.label)}」开通登录账号。${esc(s.usage)};一个主体最多一个登录账号。</p>
|
|
body = `<p class="note">为「${esc(s.label)}」开通登录账号。${esc(s.usage)};一个主体最多一个登录账号。</p>
|
|
|
- <label>登录名(写法不限 · 全站唯一)</label><input id="accLogin" placeholder="例如 zhouning 或 yz-001" value="${esc(d.login !== undefined ? d.login : s.loginDefault)}">
|
|
|
|
|
|
|
+ <label>登录名(必填 · 写法不限 · 全站唯一)</label><input id="accLogin" placeholder="例如 zhouning 或 yz-001" value="${esc(d.login !== undefined ? d.login : "")}">
|
|
|
${phoneField(d.phone !== undefined ? d.phone : "")}
|
|
${phoneField(d.phone !== undefined ? d.phone : "")}
|
|
|
${pwdField("初始密码(12 位随机:大小写字母、数字、符号)", pwd)}
|
|
${pwdField("初始密码(12 位随机:大小写字母、数字、符号)", pwd)}
|
|
|
${checks}
|
|
${checks}
|
|
@@ -1973,7 +1968,7 @@ function pageOperators() {
|
|
|
<td>${esc(o.name)}</td>
|
|
<td>${esc(o.name)}</td>
|
|
|
<td>${esc(regionPath(db, o.region))}</td>
|
|
<td>${esc(regionPath(db, o.region))}</td>
|
|
|
<td>${operatorDayText(o)}</td>
|
|
<td>${operatorDayText(o)}</td>
|
|
|
- <td class="wrap">${esc(o.payCycle)}</td>
|
|
|
|
|
|
|
+ <td>${esc(o.payCycle)}</td>
|
|
|
<td>${esc(o.notify) || "—"}</td>
|
|
<td>${esc(o.notify) || "—"}</td>
|
|
|
<td>${cnt}</td>
|
|
<td>${cnt}</td>
|
|
|
<td>${acctCell(acc)}</td>
|
|
<td>${acctCell(acc)}</td>
|
|
@@ -2381,7 +2376,7 @@ function pageSettings() {
|
|
|
</div>
|
|
</div>
|
|
|
<div class="panel"><h2>运营商覆盖与付款周期</h2>
|
|
<div class="panel"><h2>运营商覆盖与付款周期</h2>
|
|
|
<table><thead><tr><th>运营商</th><th>对账日覆盖</th><th>付款周期(只记录)</th><th>通知地址</th><th></th></tr></thead><tbody>${rows}</tbody></table>
|
|
<table><thead><tr><th>运营商</th><th>对账日覆盖</th><th>付款周期(只记录)</th><th>通知地址</th><th></th></tr></thead><tbody>${rows}</tbody></table>
|
|
|
- <p class="note">移动、联通:合同生效次月起必须付款,与其是否已向客户收妥无关;电信 ICT:按合同年 / 半年 / 季度。对账周期按月或季度,按季度也先按自然月计算再合并核对。</p>
|
|
|
|
|
|
|
+ <p class="note">付款周期按合同约定,取值为按月 / 按季度 / 按年。付款义务起点与周期分开:移动、联通自合同生效次月起必须付款,与其是否已向客户收妥无关。对账周期按月或季度,按季度也先按自然月计算再合并核对。</p>
|
|
|
</div>`);
|
|
</div>`);
|
|
|
}
|
|
}
|
|
|
|
|
|