feat(钢卷异常): 重构钢卷异常表单组件并集成到各相关页面
新增AbnormalForm组件统一管理钢卷异常表单,减少代码重复 在合卷、分条、打字等页面添加异常信息管理功能 优化异常信息展示样式,支持添加、编辑和删除操作
This commit is contained in:
@@ -439,36 +439,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-dialog title="新增异常" :visible.sync="exceptionDialogVisible" width="600px">
|
||||
<el-form ref="exceptionForm" :model="exceptionForm" label-width="80px">
|
||||
<el-form-item label="位置" prop="position">
|
||||
<el-radio-group v-model="exceptionForm.position">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_position" :key="dict.value" :label="dict.value">{{
|
||||
dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="长度坐标" prop="lengthCoord">
|
||||
<div style="display: flex; gap: 10px;">
|
||||
<el-input v-model="exceptionForm.startPosition" placeholder="请输入开始位置" />
|
||||
-
|
||||
<el-input v-model="exceptionForm.endPosition" placeholder="请输入结束位置" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="缺陷代码" prop="defectCode">
|
||||
<el-radio-group v-model="exceptionForm.defectCode">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_code" :key="dict.value" :label="dict.value">{{
|
||||
dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="程度" prop="degree">
|
||||
<el-radio-group v-model="exceptionForm.degree">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_degree" :key="dict.value" :label="dict.value">{{
|
||||
dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="exceptionForm.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<abnormal-form ref="abnormalForm" v-model="exceptionForm" :show-coil-selector="false"></abnormal-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="info" @click="handleAbnormal">查看异常</el-button>
|
||||
<el-button type="primary" @click="confirmException">确 定</el-button>
|
||||
@@ -499,6 +470,7 @@ import RawMaterialInfo from '@/components/KLPService/Renderer/RawMaterialInfo'
|
||||
import { addCoilAbnormal } from '@/api/wms/coilAbnormal'
|
||||
import LabelRender from './LabelRender/index.vue'
|
||||
import StepSplit from './stepSplit.vue'
|
||||
import AbnormalForm from '../components/AbnormalForm'
|
||||
import { getCoilTagPrintType } from '@/views/wms/coil/js/coilPrint'
|
||||
|
||||
export default {
|
||||
@@ -522,7 +494,8 @@ export default {
|
||||
ProductInfo,
|
||||
RawMaterialInfo,
|
||||
LabelRender,
|
||||
StepSplit
|
||||
StepSplit,
|
||||
AbnormalForm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -982,19 +955,22 @@ export default {
|
||||
this.exceptionDialogVisible = true
|
||||
},
|
||||
confirmException() {
|
||||
addCoilAbnormal({
|
||||
...this.exceptionForm,
|
||||
length: this.exceptionForm.endPosition - this.exceptionForm.startPosition,
|
||||
}).then(response => {
|
||||
this.$message.success('异常记录添加成功')
|
||||
this.cancelException();
|
||||
// 重置表单
|
||||
this.getMaterialCoil()
|
||||
}).catch(error => {
|
||||
console.error('异常记录添加失败:', error)
|
||||
this.$message.error('异常记录添加失败: ' + (error.message || error))
|
||||
})
|
||||
|
||||
this.$refs["abnormalForm"].validate(valid => {
|
||||
if (valid) {
|
||||
addCoilAbnormal({
|
||||
...this.exceptionForm,
|
||||
length: this.exceptionForm.endPosition - this.exceptionForm.startPosition,
|
||||
}).then(response => {
|
||||
this.$message.success('异常记录添加成功')
|
||||
this.cancelException();
|
||||
// 重置表单
|
||||
this.getMaterialCoil()
|
||||
}).catch(error => {
|
||||
console.error('异常记录添加失败:', error)
|
||||
this.$message.error('异常记录添加失败: ' + (error.message || error))
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
handleAbnormal() {
|
||||
this.$router.push({
|
||||
|
||||
Reference in New Issue
Block a user