CheckStepTwoForm.vue 16 KB
<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-form-item  :wrapperCol="{span: 19, offset: 5}">
          <a-button  type="primary" @click="submitclick()">提&nbsp;&nbsp;交</a-button>
        </a-form-item>
        <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;">一(1)一般外观检验(GB/T 15579.1-2024 3.1.7 要求)</span>
        <a-row>
          <a-col :span="24">
            <span style="color: #00A0E9">是否有明显不符合要求的缺陷?</span>
            <a-form-model-item  label="检验" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="wgjy">
              <a-input style="width: 200px;"  v-model="model.wgjy"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.wgjy2">
                <a-select-option  value="Pass">Pass</a-select-option>
                <a-select-option  value="Fail">Fail </a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
        </a-row>
        <span style="font-size: 22px;">一(2)保护性线路的连续性(GB/T 15579.1-2024 10.4.2 要求)</span>
        <a-row>
          <a-col :span="24">
            <span style="color: #00A0E9">1.用于连接外部保护性导体的接线端子是否被用于其它目的或与其它中性导体连接端接触?</span>
            <a-form-model-item  label="检验" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bhxl1">
              <a-input style="width: 200px;"  v-model="model.bhxl1"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.bhxl1v2">
                <a-select-option  value="Pass">Pass</a-select-option>
                <a-select-option  value="Fail">Fail </a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <span style="color: #00A0E9">2.用于连接外部保护性导体的接线端子上是否标有符号?</span>
            <a-form-model-item  label="检验" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bhxl2">
              <a-input style="width: 200px;"  v-model="model.bhxl2"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.bhxl2v2">
                <a-select-option  value="Pass">Pass</a-select-option>
                <a-select-option  value="Fail">Fail </a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <span style="color: #00A0E9">3.焊接电源内部与外部带绝缘的保护性导体是否是绿、黄双色(如果焊接电源用多芯柔性电缆供电,则其内部应含有绿、黄双色保护性导线)?</span>
            <a-form-model-item  label="检验" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bhxl3">
              <a-input style="width: 200px;"  v-model="model.bhxl3"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.bhxl3v2">
                <a-select-option  value="Pass">Pass</a-select-option>
                <a-select-option  value="Fail">Fail </a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <span style="color: #00A0E9">4.保护性导体和相线的安装是否能保证在电缆拉离接线端时,相线比保护性导体先拉脱?</span>
            <a-form-model-item  label="检验" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bhxl4">
              <a-input style="width: 200px;"  v-model="model.bhxl4"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.bhxl4v2">
                <a-select-option  value="Pass">Pass</a-select-option>
                <a-select-option  value="Fail">Fail </a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <span style="color: #00A0E9">5.在外壳部件和外部保护性导体接线端通以200%铭牌规定的额定最大有效值输入电流1秒,外壳部件和接线端子之间的电压降不应超过4V。</span>
            <a-form-model-item  label="检验" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bhxl5">
              <a-input style="width: 200px;"  v-model="model.bhxl5"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.bhxl5v2">
                <a-select-option  value="Pass">Pass</a-select-option>
                <a-select-option  value="Fail">Fail </a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>

        </a-row>
        <span style="font-size: 22px;">一(3)介电强度(GB/T 15579.1-2024 6.1.5)</span>
        <a-row>
            <a-col :span="24">
              <span style="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>
              </a-form-model-item>
            </a-col>
            <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>
              </a-form-model-item>
            </a-col>
            <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>
              </a-form-model-item>
            </a-col>
            <a-col :span="24">
              <span style="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>
              </a-form-model-item>
            </a-col>
            <a-col :span="24">
              <span style="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">noPass </a-select-option>
                </a-select>
              </a-form-model-item>
            </a-col>
            <a-col :span="24">
              <span style="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="noPass">noPass </a-select-option>
                </a-select>
              </a-form-model-item>
            </a-col>
        </a-row>
        <span style="font-size: 22px;">一(6)绝缘电阻(GB15579.1-2024 6.1.4)</span>
        <a-row>
          <a-col :span="24">
            <span style="color: #00A0E9">1.输入回路和焊接回路间。</span>
            <a-form-model-item  label="≧5.0 MΩ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jydz1">
              <a-input style="width: 200px;"  v-model="model.jydz1"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.jydz1v2">
                <a-select-option  value="Pass">Pass</a-select-option>
                <a-select-option  value="noPass">noPass </a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <span style="color: #00A0E9">2.输入回路和控制回路间。</span>
            <a-form-model-item label="≧2.5 MΩ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jydz2">
              <a-input style="width: 200px;"  v-model="model.jydz2" placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.jydz2v2">
                <a-select-option  value="Pass">Pass</a-select-option>
                <a-select-option  value="noPass">noPass </a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <span style="color: #00A0E9">3.输入回路和外露导体间。</span>
            <a-form-model-item label="≧2.5 MΩ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jydz3">
              <a-input style="width: 200px;" v-model="model.jydz3" placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.jydz3v2">
                <a-select-option  value="Pass">Pass</a-select-option>
                <a-select-option  value="noPass">noPass </a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <span style="color: #00A0E9">4.焊接回路和控制回路间</span>
            <a-form-model-item label="≧2.5 MΩ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jydz4">
              <a-input style="width: 200px;" v-model="model.jydz4" placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.jydz4v2">
                <a-select-option  value="Pass">Pass</a-select-option>
                <a-select-option  value="noPass">noPass </a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <span style="color: #00A0E9">5.焊接回路和外露导体间。</span>
            <a-form-model-item label="≧2.5 MΩ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jydz5">
              <a-input style="width: 200px;" v-model="model.jydz5" placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.jydz5v2">
                <a-select-option  value="Pass">Pass</a-select-option>
                <a-select-option  value="noPass">noPass </a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <span style="color: #00A0E9">6.控制回路和外露导体间。</span>
            <a-form-model-item label="≧2.5 MΩ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jydz6">
              <a-input style="width: 200px;" v-model="model.jydz6" placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.jydz6v2">
                <a-select-option  value="Pass">Pass</a-select-option>
                <a-select-option  value="noPass">noPass </a-select-option>
              </a-select>
            </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'

  export default {
    name: 'CheckStepTwoForm',
    components: {
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      }
    },
    data () {
      return {
        model:{
         },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
validatorRules: {
        snCode: [
            { required: true, message: '请输入sn编码!'},
        ],
},
        url: {
          add: "/jianyan/checkStepTwo/add",
          edit: "/jianyan/checkStepTwo/edit",
          queryById: "/jianyan/checkStepTwo/queryById"
        }
      }
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    },
    created () {
       //备份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;
      },
      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;
            })
          }
         
        })
      },
      submitclick(){
        this.submitForm();
      }
    }
  }
</script>