v1.0.25: 渠道计划费用(元)字段非已执行状态仅禁用不改变CSS样式(行内编辑+新增计划弹窗)

This commit is contained in:
nanguaboss
2026-08-09 14:52:42 +08:00
parent 808c8cbd5c
commit 2ed8cc00e7
2 changed files with 6 additions and 9 deletions
+5 -8
View File
@@ -220,7 +220,7 @@ $(function () {
'<option value="已执行"' + (r.status === '已执行' ? ' selected' : '') + '>已执行</option>' + '<option value="已执行"' + (r.status === '已执行' ? ' selected' : '') + '>已执行</option>' +
'<option value="错过"' + (r.status === '错过' ? ' selected' : '') + '>错过</option></select>'; '<option value="错过"' + (r.status === '错过' ? ' selected' : '') + '>错过</option></select>';
var costInput = '<input type="text" class="plan-cost" data-id="' + r.id + '" value="' + escHtml(r.cost !== null && r.cost !== undefined ? r.cost : '') + '" placeholder="0.00"' + var costInput = '<input type="text" class="plan-cost" data-id="' + r.id + '" value="' + escHtml(r.cost !== null && r.cost !== undefined ? r.cost : '') + '" placeholder="0.00"' +
(r.status === '已执行' ? '' : ' disabled style="background:#f2f4f8;color:#8a94a6;"') + ' style="width:90px;height:28px;padding:0 6px;font-size:12px;border:1px solid #d9dee8;border-radius:4px;text-align:right;">'; (r.status === '已执行' ? '' : ' disabled') + ' style="width:90px;height:28px;padding:0 6px;font-size:12px;border:1px solid #d9dee8;border-radius:4px;text-align:right;">';
html += '<tr>' + html += '<tr>' +
'<td>' + r.id + '</td>' + '<td>' + r.id + '</td>' +
'<td>' + escHtml(r.channel_type) + '</td>' + '<td>' + escHtml(r.channel_type) + '</td>' +
@@ -249,11 +249,8 @@ $(function () {
var status = $(this).val(); var status = $(this).val();
var $row = $(this).closest('tr'); var $row = $(this).closest('tr');
var $cost = $row.find('.plan-cost'); var $cost = $row.find('.plan-cost');
if (status === '已执行') { // 仅控制可编辑性,不改 CSS 样式(保持「已执行」的样式呈现)
$cost.prop('disabled', false).css({ background: '#fff', color: '#1e2a3a' }); $cost.prop('disabled', status !== '已执行');
} else {
$cost.prop('disabled', true).css({ background: '#f2f4f8', color: '#8a94a6' });
}
httpPost('channel/plan_save.php', { id: id, status: status }).then(function () { httpPost('channel/plan_save.php', { id: id, status: status }).then(function () {
Dialog.toast('状态已更新为「' + status + '」'); Dialog.toast('状态已更新为「' + status + '」');
}).catch(function () { }).catch(function () {
@@ -336,7 +333,7 @@ $(function () {
' <option value="已执行"' + (r.status === '已执行' ? ' selected' : '') + '>已执行</option>' + ' <option value="已执行"' + (r.status === '已执行' ? ' selected' : '') + '>已执行</option>' +
' <option value="错过"' + (r.status === '错过' ? ' selected' : '') + '>错过</option></select></div>' + ' <option value="错过"' + (r.status === '错过' ? ' selected' : '') + '>错过</option></select></div>' +
' <div class="form-item"><label>费用(元)</label><input type="text" name="cost" value="' + escHtml(r.cost !== null && r.cost !== undefined ? r.cost : '') + '" placeholder="仅已执行时可填写"' + ' <div class="form-item"><label>费用(元)</label><input type="text" name="cost" value="' + escHtml(r.cost !== null && r.cost !== undefined ? r.cost : '') + '" placeholder="仅已执行时可填写"' +
(r.status === '已执行' ? '' : ' disabled style="background:#f2f4f8;color:#8a94a6;"') + '></div>' + (r.status === '已执行' ? '' : ' disabled') + '></div>' +
' <div class="form-item"><label>开始日期</label><input type="date" name="start_date" value="' + escHtml(r.start_date || '') + '"></div>' + ' <div class="form-item"><label>开始日期</label><input type="date" name="start_date" value="' + escHtml(r.start_date || '') + '"></div>' +
' <div class="form-item"><label>结束日期</label><input type="date" name="end_date" value="' + escHtml(r.end_date || '') + '"></div>' + ' <div class="form-item"><label>结束日期</label><input type="date" name="end_date" value="' + escHtml(r.end_date || '') + '"></div>' +
' <div class="form-item full"><label>备注说明</label><input type="text" name="remark" value="' + escHtml(r.remark || '') + '"></div>' + ' <div class="form-item full"><label>备注说明</label><input type="text" name="remark" value="' + escHtml(r.remark || '') + '"></div>' +
@@ -358,8 +355,8 @@ $(function () {
$('#plan-form select[name="status"]').on('change', function () { $('#plan-form select[name="status"]').on('change', function () {
var enabled = $(this).val() === '已执行'; var enabled = $(this).val() === '已执行';
var $cost = $('#plan-form input[name="cost"]'); var $cost = $('#plan-form input[name="cost"]');
// 仅控制可编辑性,不改 CSS 样式
$cost.prop('disabled', !enabled); $cost.prop('disabled', !enabled);
$cost.css({ background: enabled ? '#fff' : '#f2f4f8', color: enabled ? '#1e2a3a' : '#8a94a6' });
if (!enabled) $cost.val(''); if (!enabled) $cost.val('');
}); });
+1 -1
View File
@@ -5,7 +5,7 @@ var BASE_URL = '/api/';
var PAGE_SIZE = 20; var PAGE_SIZE = 20;
/** 系统版本号(logo旁展示):修改代码后运行 tools/bump_version.php 自动递增 */ /** 系统版本号(logo旁展示):修改代码后运行 tools/bump_version.php 自动递增 */
var APP_VERSION = 'v1.0.24'; var APP_VERSION = 'v1.0.25';
/** 页脚版权/备案信息(在 config.js 中修改) */ /** 页脚版权/备案信息(在 config.js 中修改) */
var FOOTER_TEXT = '© 2026 SuperLink 管理系统 版权所有 | 备案号:请替换为真实备案号'; var FOOTER_TEXT = '© 2026 SuperLink 管理系统 版权所有 | 备案号:请替换为真实备案号';