CheckStepOneForm.vue
8.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="sn编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="snCode">
<a-input v-model="model.snCode" type="text" placeholder="请输入sn编码" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
<span style="font-size: 22px;">一(3)介电强度(GB/T15579.1-2024 6.1.5)</span>
<a-row>
<a-col :span="24">
<span style="font-size: 16px;color: #00A0E9">1.所有回路对外露导电部件应能承受规定的试验电压而无闪络或击穿。</span>
<a-form-model-item label="最大额定电压<=50" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jdqd1">
<a-input style="width: 200px;" v-model="model.jdqd1" placeholder="请输入检验结果" ></a-input>
<a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.jdqd1v2">
<a-select-option value="Pass">Pass</a-select-option>
<a-select-option value="Fail">Fail </a-select-option>
</a-select>
<!-- <j-dict-select-tag style="width: 200px;" placeholder="请选择判定结果" v-model="model.jdqd1_2" dictCode="pass_status"/>-->
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-model-item label="最大额定电压220" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jdqd2">
<a-input style="width: 200px;" v-model="model.jdqd2" placeholder="请输入检验结果" ></a-input>
<a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.jdqd2v2">
<a-select-option value="Pass">Pass</a-select-option>
<a-select-option value="Fail">Fail </a-select-option>
</a-select>
<!-- <j-dict-select-tag style="width: 200px;" placeholder="请选择判定结果" v-model="model.jdqd2_2" dictCode="pass_status"/>-->
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-model-item label="最大额定电压450" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jdqd3">
<a-input style="width: 200px;" v-model="model.jdqd3" placeholder="请输入检验结果" ></a-input>
<a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.jdqd3v2">
<a-select-option value="Pass">Pass</a-select-option>
<a-select-option value="Fail">Fail </a-select-option>
</a-select>
<!-- <j-dict-select-tag style="width: 200px;" placeholder="请选择判定结果" v-model="model.jdqd3_2" dictCode="pass_status"/>-->
</a-form-model-item>
</a-col>
<a-col :span="24">
<span style="font-size: 16px;color: #00A0E9">1.输入回路对控制回路应能承受规定的试验电压而无闪络或击穿现象。</span>
<a-form-model-item label="最大额定电压450" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jdqd4">
<a-input style="width: 200px;" v-model="model.jdqd4" placeholder="请输入检验结果" ></a-input>
<a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.jdqd4v2">
<a-select-option value="Pass">Pass</a-select-option>
<a-select-option value="Fail">Fail </a-select-option>
</a-select>
<!-- <j-dict-select-tag style="width: 200px;" placeholder="请选择判定结果" v-model="model.jdqd4_2" dictCode="pass_status"/>-->
</a-form-model-item>
</a-col>
<a-col :span="24">
<span style="font-size: 16px;color: #00A0E9">2.焊接回路对控制回路应能承受规定的试验电压而无闪络或击穿现象。</span>
<a-form-model-item label="最大额定电压220" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jdqd5">
<a-input style="width: 200px;" v-model="model.jdqd5" placeholder="请输入检验结果" ></a-input>
<a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.jdqd5v2">
<a-select-option value="Pass">Pass</a-select-option>
<a-select-option value="Fail">Fail </a-select-option>
</a-select>
<!-- <j-dict-select-tag style="width: 200px;" placeholder="请选择判定结果" v-model="model.jdqd5_2" dictCode="pass_status"/>-->
</a-form-model-item>
</a-col>
<a-col :span="24">
<span style="font-size: 16px;color: #00A0E9">3.输入回路对焊接回路应能承受规定的试验电压而无闪络或击穿现象。</span>
<a-form-model-item label="最大额定电压450" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jdqd6">
<a-input style="width: 200px;" v-model="model.jdqd6" placeholder="请输入检验结果" ></a-input>
<a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.jdqd6v2">
<a-select-option value="Pass">Pass</a-select-option>
<a-select-option value="Fail">Fail </a-select-option>
</a-select>
<!-- <j-dict-select-tag style="width: 200px;" placeholder="请选择判定结果" v-model="model.jdqd6_2" dictCode="pass_status"/>-->
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import {ajaxGetDictItems, getDictItemsFromCache} from "@api/api";
export default {
name: 'CheckStepOneForm',
components: {
},
props: {
//表单禁用
},
data () {
return {
model:{
jdqd1:'500',
jdqd2:'1100',
jdqd3:'1875',
jdqd4:'1875',
jdqd5:'1100',
jdqd6:'3750'
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/jianyan/checkStepOne/add",
edit: "/jianyan/checkStepOne/edit",
queryById: "/jianyan/checkStepOne/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//备份model原始值
console.log('111==',this.model)
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
console.log('1212==',this.model)
},
submitForm () {
const that = this;
if(this.model.snCode==undefined||this.model.snCode==''){
this.$message.warning('请先填写sn编码!');
return;
}
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>