feat(钢卷管理): 添加钢卷号前缀生成功能并优化样式

添加钢卷号前缀生成工具函数及测试用例
在合并、拆分、分条和录入页面使用自动生成的钢卷号前缀
调整EmployeeSelector组件默认触发器的样式
移除typing.vue中未使用的变更历史代码块
添加钢卷号长度校验规则
This commit is contained in:
砂糖
2026-03-03 14:15:45 +08:00
parent d927aa8647
commit 07e982b736
7 changed files with 162 additions and 46 deletions

View File

@@ -215,45 +215,6 @@
</el-card>
</div>
</div>
<!-- 变更历史占满整行 -->
<!-- <div class="history-section">
<el-card class="history-card">
<div slot="header" class="card-header">
<span><i class="el-icon-time"></i> 变更历史</span>
<el-button type="text" size="mini" @click="loadHistory" :loading="historyLoading">
<i class="el-icon-refresh"></i> 刷新
</el-button>
</div>
<el-timeline v-if="historySteps.length > 0">
<el-timeline-item v-for="(step, index) in historySteps" :key="index"
:timestamp="`步骤 ${step.display_step || step.step}`" placement="top"
:type="step.operation === '新增' ? 'success' : 'primary'">
<div class="history-item">
<div class="history-title">{{ step.operation || step.action }}</div>
<div class="history-detail" v-if="step.operator">
<span class="detail-label">操作人</span>
<span>{{ step.operator }}</span>
</div>
<div class="history-detail" v-if="step.old_current_coil_no">
<span class="detail-label">原钢卷号</span>
<span>{{ step.old_current_coil_no }}</span>
</div>
<div class="history-detail" v-if="step.new_current_coil_no">
<span class="detail-label">新钢卷号</span>
<span>{{ step.new_current_coil_no }}</span>
</div>
</div>
</el-timeline-item>
</el-timeline>
<div v-else class="empty-history">
<i class="el-icon-document"></i>
<p>暂无变更历史</p>
</div>
</el-card>
</div> -->
</div>
</template>
@@ -268,6 +229,7 @@ import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect
import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
import ProductSelect from "@/components/KLPService/ProductSelect";
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
import { generateCoilNoPrefix } from "@/utils/coil/coilNo";
export default {
name: 'TypingCoil',
@@ -324,6 +286,16 @@ export default {
rules: {
currentCoilNo: [
{ required: true, message: '请输入当前钢卷号', trigger: 'blur' },
{
// 当前钢卷号必须大于等于10位
validator: (rule, value, callback) => {
if (value.length < 10) {
callback(new Error('当前钢卷号必须大于等于10位'));
} else {
callback();
}
}, trigger: 'blur'
},
// 仅在新增的时候校验
{
validator: (rule, value, callback) => {
@@ -524,6 +496,9 @@ export default {
}
}
const currentCoilNoPrefix = generateCoilNoPrefix()
this.$set(this.updateForm, 'currentCoilNo', currentCoilNoPrefix)
if (actionId) {
this.actionId = actionId;
}