Commit 42ac7fe9 by suyuchen

feat(service): 统一将零件费用相关术语更新为配件费用

- 将所有页面中的零件费用标准相关文本替换为配件费用标准 - 更新首页统计卡片中零件费用标准数量标签为配件费用标准数量 - 修改导航菜单中零件费用管理为配件费用管理 - 重命名零件费用标准管理列表页标题为配件费用标准管理 - 更新零件费用标准新增编辑页标题为配件费用标准新增编辑 - 替换标准报价单生成页中零件费用明细为配件费用明细 - 修改标准报价单详情页中零件费用明细为配件费用明细 - 更新服务价格白皮书中零件费用说明为配件费用说明 - 重命名侧边栏中设备管理为服务管理并调整菜单结构 - 新增配件管理页面文件 - 在数据收集系统中添加系统网址和统计信息字段
parent c76c8ec9
<!DOCTYPE html>
<!DOCTYPE html>
......@@ -1306,7 +1306,7 @@
<div class="breadcrumb">
<span>首页</span>
<span class="breadcrumb-separator">/</span>
<span class="breadcrumb-current">设备档案编辑</span>
<span class="breadcrumb-current">设备机型</span>
</div>
</div>
<div class="header-right">
......@@ -1326,14 +1326,250 @@
<div class="main-content">
<div class="content-area">
<div class="card">
<img src="./img_4.png" alt="" style="width: 100%;">
<div class="card" style="padding: 20px;">
<!-- <img src="./img_4.png" alt="" style="width: 100%;">-->
<div class="page-header">
<div>
<h1 class="page-title" data-i18n="title">设备机型</h1>
</div>
<div class="toolbar" style="display:flex;justify-content: end;margin-bottom: 20px;">
<!-- <button class="btn btn-primary" style="text-align: right;padding: 8px 28px;margin-right: 4px;" onclick="handleAdd">批量导入</button>-->
<button class="btn btn-primary" style="text-align: right;padding: 8px 28px;" onclick="showAddModal()">+ 新增配件</button>
</div>
</div>
<div class="table-container">
<table class="el-table__header" style="width: 100%;">
<thead class="has-gutter">
<tr class="">
<th class="is-leaf"><div class="cell"><span>编码</span></div></th>
<th class="is-leaf"><div class="cell"><span>名称</span></div></th>
<th class="is-leaf"><div class="cell"><span>工序</span></div></th>
<th class="is-leaf"><div class="cell"><span>设备类别</span></div></th>
<th class="is-leaf"><div class="cell"><span>功率(kw/h)</span></div></th>
<th class="is-leaf"><div class="cell"><span>关联设备数(台)</span></div></th>
<th class="is-leaf"><div class="cell"></div></th>
<th class="is-center is-leaf"><div class="cell"><span>操作</span></div></th>
</tr>
</thead>
<tbody id="deviceTableBody">
<tr>
<td><div class="cell">E001</div></td>
<td><div class="cell">注塑机A型</div></td>
<td><div class="cell">注塑成型</div></td>
<td><div class="cell">注塑设备</div></td>
<td><div class="cell">15.5</div></td>
<td><div class="cell">3</div></td>
<td><div class="cell"></div></td>
<td class="is-center">
<div class="cell">
<button class="action-btn edit-btn" onclick="editDevice(this)"><i class="fas fa-edit"></i> 编辑</button>
<button class="action-btn delete-btn" onclick="deleteDevice(this)"><i class="fas fa-trash"></i> 删除</button>
</div>
</td>
</tr>
<tr>
<td><div class="cell">E002</div></td>
<td><div class="cell">冲压机B型</div></td>
<td><div class="cell">冲压成型</div></td>
<td><div class="cell">冲压设备</div></td>
<td><div class="cell">22.0</div></td>
<td><div class="cell">2</div></td>
<td><div class="cell"></div></td>
<td class="is-center">
<div class="cell">
<button class="action-btn edit-btn" onclick="editDevice(this)"><i class="fas fa-edit"></i> 编辑</button>
<button class="action-btn delete-btn" onclick="deleteDevice(this)"><i class="fas fa-trash"></i> 删除</button>
</div>
</td>
</tr>
<tr>
<td><div class="cell">E003</div></td>
<td><div class="cell">CNC加工中心</div></td>
<td><div class="cell">精密加工</div></td>
<td><div class="cell">数控设备</div></td>
<td><div class="cell">37.0</div></td>
<td><div class="cell">5</div></td>
<td><div class="cell"></div></td>
<td class="is-center">
<div class="cell">
<button class="action-btn edit-btn" onclick="editDevice(this)"><i class="fas fa-edit"></i> 编辑</button>
<button class="action-btn delete-btn" onclick="deleteDevice(this)"><i class="fas fa-trash"></i> 删除</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- 新增/编辑表单模态框 -->
<div class="modal" id="addModal">
<div class="modal-content add-modal-content">
<div class="modal-header">
<h3 class="modal-title" id="modalTitle">新增设备</h3>
<button class="close-modal" onclick="closeModal()">&times;</button>
</div>
<div class="modal-body">
<form class="add-modal-form" id="deviceForm">
<div class="form-row">
<div class="form-group">
<label for="deviceName">名称 *</label>
<input type="text" id="deviceName" placeholder="请输入设备名称">
</div>
<div class="form-group">
<label for="deviceCode">编码 *</label>
<input type="text" id="deviceCode" placeholder="请输入设备编码">
</div>
</div>
<div class="form-row">
<div class="form-group">
<label for="devicePower">功率(kw/h) *</label>
<input type="number" id="devicePower" placeholder="请输入设备功率">
</div>
<div class="form-group">
<label for="deviceType">设备类型 *</label>
<select id="deviceType">
<option value="">请选择设备类型</option>
<option value="注塑设备">注塑设备</option>
<option value="冲压设备">冲压设备</option>
<option value="数控设备">数控设备</option>
<option value="装配设备">装配设备</option>
<option value="检测设备">检测设备</option>
</select>
</div>
</div>
<div class="form-group">
<label for="process">工序 *</label>
<input type="text" id="process" placeholder="请输入工序">
</div>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" onclick="closeModal()">取消</button>
<button class="btn btn-primary" onclick="saveDevice()">保存</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
// 设备数据
let devices = [
{ id: 1, code: 'E001', name: '注塑机A型', process: '注塑成型', deviceType: '注塑设备', power: 15.5, relatedCount: 3 },
{ id: 2, code: 'E002', name: '冲压机B型', process: '冲压成型', deviceType: '冲压设备', power: 22.0, relatedCount: 2 },
{ id: 3, code: 'E003', name: 'CNC加工中心', process: '精密加工', deviceType: '数控设备', power: 37.0, relatedCount: 5 }
];
let editingId = null;
// 显示新增模态框
function showAddModal() {
document.getElementById('modalTitle').textContent = '新增设备';
document.getElementById('deviceForm').reset();
editingId = null;
document.getElementById('addModal').style.display = 'flex';
}
// 编辑设备
function editDevice(button) {
const row = button.closest('tr');
const cells = row.querySelectorAll('td div.cell');
document.getElementById('modalTitle').textContent = '编辑设备';
document.getElementById('deviceName').value = cells[1].textContent;
document.getElementById('deviceCode').value = cells[0].textContent;
document.getElementById('devicePower').value = cells[4].textContent;
document.getElementById('process').value = cells[2].textContent;
document.getElementById('deviceType').value = cells[3].textContent;
editingId = cells[0].textContent; // 使用编码作为ID
document.getElementById('addModal').style.display = 'flex';
}
// 删除设备
function deleteDevice(button) {
if (confirm('确定要删除这个设备吗?')) {
const row = button.closest('tr');
row.remove();
}
}
// 保存设备
function saveDevice() {
const name = document.getElementById('deviceName').value;
const code = document.getElementById('deviceCode').value;
const power = document.getElementById('devicePower').value;
const deviceType = document.getElementById('deviceType').value;
const process = document.getElementById('process').value;
if (!name || !code || !power || !deviceType || !process) {
alert('请填写所有必填字段');
return;
}
if (editingId) {
// 更新现有设备
const table = document.getElementById('deviceTableBody');
const rows = table.querySelectorAll('tr');
for (let row of rows) {
const cells = row.querySelectorAll('td div.cell');
if (cells[0].textContent === editingId) {
cells[0].textContent = code;
cells[1].textContent = name;
cells[2].textContent = process;
cells[3].textContent = deviceType;
cells[4].textContent = power;
break;
}
}
} else {
// 添加新设备
const newRow = document.createElement('tr');
newRow.innerHTML = `
<td><div class="cell">${code}</div></td>
<td><div class="cell">${name}</div></td>
<td><div class="cell">${process}</div></td>
<td><div class="cell">${deviceType}</div></td>
<td><div class="cell">${power}</div></td>
<td><div class="cell">0</div></td>
<td><div class="cell"></div></td>
<td class="is-center">
<div class="cell">
<button class="action-btn edit-btn" onclick="editDevice(this)"><i class="fas fa-edit"></i> 编辑</button>
<button class="action-btn delete-btn" onclick="deleteDevice(this)"><i class="fas fa-trash"></i> 删除</button>
</div>
</td>
`;
document.getElementById('deviceTableBody').appendChild(newRow);
}
closeModal();
}
// 关闭模态框
function closeModal() {
document.getElementById('addModal').style.display = 'none';
}
// 点击模态框外部关闭
window.onclick = function(event) {
const modal = document.getElementById('addModal');
if (event.target === modal) {
closeModal();
}
}
</script>
</body>
<script src="./js.js"></script>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment