diff --git a/klp-ui/src/components/KLPService/Renderer/CoilNo.vue b/klp-ui/src/components/KLPService/Renderer/CoilNo.vue index db005ee5..fea7c2ce 100644 --- a/klp-ui/src/components/KLPService/Renderer/CoilNo.vue +++ b/klp-ui/src/components/KLPService/Renderer/CoilNo.vue @@ -99,7 +99,16 @@ export default { }, supplierCoilNo() { return this.coilInfo.supplierCoilNo || '-' - } + }, + length() { + return this.coilInfo.length || '-' + }, + actualLength() { + return this.coilInfo.actualLength || '-' + }, + actualWidth() { + return this.coilInfo.actualWidth || '-' + }, }, methods: { getCoilInfo() { diff --git a/klp-ui/src/views/wms/coil/abnormalCoil.vue b/klp-ui/src/views/wms/coil/abnormalCoil.vue index 10dfd152..ed82590f 100644 --- a/klp-ui/src/views/wms/coil/abnormalCoil.vue +++ b/klp-ui/src/views/wms/coil/abnormalCoil.vue @@ -111,38 +111,7 @@ - - - - - - - {{ - dict.label }} - - - - - - - - - - - {{ - dict.label }} - - - - - {{ - dict.label }} - - - - - - + @@ -161,13 +111,15 @@ import { listCoilAbnormal, getCoilAbnormal, delCoilAbnormal, addCoilAbnormal, updateCoilAbnormal, judgeAbnormalLevel } from "@/api/wms/coilAbnormal"; import CoilSelector from '@/components/CoilSelector' import CoilNo from '@/components/KLPService/Renderer/CoilNo' +import AbnormalForm from './components/AbnormalForm' export default { name: "CoilAbnormal", dicts: ['coil_abnormal_code', 'coil_abnormal_position', 'coil_abnormal_degree', 'coil_abnormal_level'], components: { CoilSelector, - CoilNo + CoilNo, + AbnormalForm }, data() { return { @@ -205,9 +157,6 @@ export default { }, // 表单参数 form: {}, - // 表单校验 - rules: { - }, judgeOpen: false, }; }, @@ -259,7 +208,9 @@ export default { updateTime: undefined, updateBy: undefined }; - this.resetForm("form"); + if (this.$refs.abnormalForm) { + this.$refs.abnormalForm.resetFields(); + } }, /** 搜索按钮操作 */ handleQuery() { @@ -297,7 +248,7 @@ export default { }, /** 提交按钮 */ submitForm() { - this.$refs["form"].validate(valid => { + this.$refs["abnormalForm"].validate(valid => { if (valid) { this.buttonLoading = true; if (this.form.abnormalId != null) { diff --git a/klp-ui/src/views/wms/coil/components/AbnormalForm.vue b/klp-ui/src/views/wms/coil/components/AbnormalForm.vue new file mode 100644 index 00000000..f53972bc --- /dev/null +++ b/klp-ui/src/views/wms/coil/components/AbnormalForm.vue @@ -0,0 +1,113 @@ + + + diff --git a/klp-ui/src/views/wms/coil/merge.vue b/klp-ui/src/views/wms/coil/merge.vue index 8103ca40..df936ef0 100644 --- a/klp-ui/src/views/wms/coil/merge.vue +++ b/klp-ui/src/views/wms/coil/merge.vue @@ -230,11 +230,61 @@ + +
+ +
+
+
+
+
{{ getAbnormalPositionText(abnormal.position) }}
+
{{ getAbnormalCodeText(abnormal.defectCode) }}
+
+ +
+
+
+ +
+
+
+
+ + + + + + @@ -247,6 +297,7 @@ import RawMaterialSelector from "@/components/KLPService/RawMaterialSelect"; import ProductSelector from "@/components/KLPService/ProductSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; import TimeInput from "@/components/TimeInput"; +import AbnormalForm from './components/AbnormalForm'; import { generateCoilNoPrefix } from "@/utils/coil/coilNo"; export default { @@ -257,9 +308,10 @@ export default { RawMaterialSelector, ProductSelector, WarehouseSelect, - TimeInput + TimeInput, + AbnormalForm }, - dicts: ['coil_quality_status'], + dicts: ['coil_quality_status', 'coil_abnormal_position', 'coil_abnormal_code', 'coil_abnormal_degree'], data() { const currentCoilNoPrefix = generateCoilNoPrefix() return { @@ -332,7 +384,24 @@ export default { pendingLoading: false, // 待操作ID actionId: null, - currentAction: {} + currentAction: {}, + // 异常信息 + abnormals: [], + // 异常表单弹窗 + abnormalDialogVisible: false, + // 当前编辑的异常索引 + currentAbnormalIndex: -1, + // 异常表单数据 + abnormalForm: { + coilId: null, + position: null, + startPosition: 0, + endPosition: 0, + length: 0, + defectCode: null, + degree: null, + remark: null + } }; }, computed: { @@ -681,6 +750,7 @@ export default { ...this.targetCoil, enterCoilNo: enterCoilNos, // 拼接的入场钢卷号 hasMergeSplit: 2, // 2表示合卷 + abnormals: this.abnormals, newCoils: this.sourceCoils.map(item => ({ coilId: item.coilId, enterCoilNo: item.enterCoilNo, @@ -836,6 +906,78 @@ export default { // closePage 关闭当前页面 closePage() { this.$router.back(); + }, + + // 新增异常 + addAbnormal() { + this.currentAbnormalIndex = -1; + this.abnormalForm = { + coilId: null, + position: null, + startPosition: 0, + endPosition: 0, + length: 0, + defectCode: null, + degree: null, + remark: null + }; + this.abnormalDialogVisible = true; + }, + + // 编辑异常 + editAbnormal(index) { + this.currentAbnormalIndex = index; + this.abnormalForm = { ...this.abnormals[index] }; + this.abnormalDialogVisible = true; + }, + + // 保存异常 + saveAbnormal() { + this.$refs.abnormalForm.validate(valid => { + if (valid) { + // 计算缺陷长度 + this.abnormalForm.length = this.abnormalForm.endPosition - this.abnormalForm.startPosition; + + if (this.currentAbnormalIndex === -1) { + // 新增异常 + this.abnormals.push({ ...this.abnormalForm }); + } else { + // 编辑异常 + this.abnormals[this.currentAbnormalIndex] = { ...this.abnormalForm }; + } + + this.abnormalDialogVisible = false; + } + }); + }, + + // 删除异常 + deleteAbnormal(index) { + this.$confirm('确定要删除这个异常信息吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.abnormals.splice(index, 1); + }); + }, + + // 获取异常位置文本 + getAbnormalPositionText(position) { + if (!position) return ''; + const dict = this.dict.type.coil_abnormal_position; + if (!dict) return position; + const item = dict.find(item => item.value === position); + return item ? item.label : position; + }, + + // 获取异常代码文本 + getAbnormalCodeText(code) { + if (!code) return ''; + const dict = this.dict.type.coil_abnormal_code; + if (!dict) return code; + const item = dict.find(item => item.value === code); + return item ? item.label : code; } } }; @@ -1256,4 +1398,86 @@ export default { } } } + + +.abnormal-container { + display: flex; + flex-wrap: wrap; + gap: 10px; + margin-top: 5px; +} + +.abnormal-item { + width: 120px; + height: 80px; + background-color: #fff1f0; + border: 1px solid #ff4d4f; + border-radius: 4px; + cursor: pointer; + transition: all 0.3s ease; + position: relative; + + &:hover { + box-shadow: 0 2px 8px rgba(255, 77, 79, 0.2); + transform: translateY(-2px); + } + + .abnormal-content { + padding: 8px; + height: 100%; + display: flex; + flex-direction: column; + justify-content: space-between; + } + + .abnormal-info { + flex: 1; + } + + .abnormal-position { + font-size: 12px; + font-weight: 500; + color: #ff4d4f; + margin-bottom: 4px; + } + + .abnormal-code { + font-size: 11px; + color: #666; + line-height: 1.3; + } + + .abnormal-delete { + position: absolute; + top: -8px; + right: -8px; + width: 20px; + height: 20px; + padding: 0; + display: flex; + align-items: center; + justify-content: center; + border-radius: 50%; + background-color: #fff; + } +} + +.abnormal-add { + width: 120px; + height: 80px; + border: 2px dashed #ff4d4f; + border-radius: 4px; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + transition: all 0.3s ease; + color: #ff4d4f; + font-size: 24px; + + &:hover { + background-color: #fff1f0; + transform: translateY(-2px); + } +} diff --git a/klp-ui/src/views/wms/coil/panels/abnormal.vue b/klp-ui/src/views/wms/coil/panels/abnormal.vue index 216817e9..de8567a0 100644 --- a/klp-ui/src/views/wms/coil/panels/abnormal.vue +++ b/klp-ui/src/views/wms/coil/panels/abnormal.vue @@ -58,35 +58,7 @@ - - - - {{ - dict.label }} - - - - - - - - - - - {{ - dict.label }} - - - - - {{ - dict.label }} - - - - - - +