CheckStepFourForm.vue 17.4 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="sncode" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="snCode">
              <a-input v-model="model.snCode" placeholder="请输入sncode"  ></a-input>

            </a-form-model-item>
          </a-col>
        </a-row>
        <span style="font-size: 22px;">一(7)、一般外观检验</span>

        <a-row>
          <a-col :span="26">
            <a-form-model-item label="1.铭牌内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg1">
              <a-input style="width: 200px;"  v-model="model.ybwg1"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg1v1">
                <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="26">
            <a-form-model-item label="2.贴纸内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg2">
              <a-input style="width: 200px;"  v-model="model.ybwg2"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg2v1">
                <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 >
            <a-form-model-item label="3.说明书内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg3">
              <a-input style="width: 200px;"  v-model="model.ybwg3"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg3v1">
                <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 >
            <a-form-model-item label="4.输入线连接标记" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg4">
              <a-input style="width: 200px;"  v-model="model.ybwg4"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg4v1">
                <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 >
            <a-form-model-item label="5.接地端标记" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg5">
              <a-input style="width: 200px;"  v-model="model.ybwg5"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg5v1">
                <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 >
            <a-form-model-item label="6.机箱外壳" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg6">
              <a-input style="width: 200px;"  v-model="model.ybwg6"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg6v1">
                <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 >
            <a-form-model-item label="7.机箱表面油漆" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg7">
              <a-input style="width: 200px;"  v-model="model.ybwg7"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg7v1">
                <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 style="font-size: 16px;color: #00A0E9">8.机箱表面丝印</span>
            <a-form-model-item label="位置正确,无偏移,倾斜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg8">
              <a-input style="width: 200px;"  v-model="model.ybwg8"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg8v1">
                <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 >
            <a-form-model-item label="图标字符清晰完整" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg9">
              <a-input style="width: 200px;"  v-model="model.ybwg9"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg9v1">
                <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 style="font-size: 16px;color: #00A0E9">9.控制面板</span>
            <a-form-model-item label="表面清洁,字迹清晰,按钮手感良好" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg10">
              <a-input style="width: 200px;"  v-model="model.ybwg10"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg10v1">
                <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 >
            <a-form-model-item label="面膜粘合牢固、平整" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg11">
              <a-input style="width: 200px;"  v-model="model.ybwg11"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg11v1">
                <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 >
            <a-form-model-item label="面膜安装位置无误与按键相对应" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg12">
              <a-input style="width: 200px;"  v-model="model.ybwg12"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg12v1">
                <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 style="font-size: 16px;color: #00A0E9">10.铭牌</span>
            <a-form-model-item label="型号正确" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg13">
              <a-input style="width: 200px;"  v-model="model.ybwg13"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg13v1">
                <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 >
            <a-form-model-item label="标识内容清晰,完整,正确" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg14">
              <a-input style="width: 200px;"  v-model="model.ybwg14"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg14v1">
                <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>
            <a-form-model-item label="位置正确,无偏移,倾斜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg15">
              <a-input style="width: 200px;"  v-model="model.ybwg15"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg15v1">
                <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 style="font-size: 16px;color: #00A0E9">11.紧固件</span>
            <a-form-model-item label="规格使用正确,安装牢固,无变形" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg16">
              <a-input style="width: 200px;"  v-model="model.ybwg16"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg16v1">
                <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 >
            <a-form-model-item label="表面处理层完好,无锈迹,无压痕" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg17">
              <a-input style="width: 200px;"  v-model="model.ybwg17"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg17v1">
                <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 style="font-size: 16px;color: #00A0E9">12.连接件</span>
            <a-form-model-item label="航插安装位置正确规范" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg18">
              <a-input style="width: 200px;"  v-model="model.ybwg18"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg18v1">
                <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 >
            <a-form-model-item label="航插安装牢固、固定螺丝无松动" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg19">
              <a-input style="width: 200px;"  v-model="model.ybwg19"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg19v1">
                <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 >
            <a-form-model-item label="航插针安装牢固、无松动" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg20">
              <a-input style="width: 200px;"  v-model="model.ybwg20"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg20v1">
                <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 >
            <a-form-model-item label="进/出气接头安装位置正确规范" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg21">
              <a-input style="width: 200px;"  v-model="model.ybwg21"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg21v1">
                <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 >
            <a-form-model-item label="进/出气接头安装牢固、无跟转" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ybwg22">
              <a-input style="width: 200px;"  v-model="model.ybwg22"  placeholder="请输入检验结果"  ></a-input>
              <a-select style="width: 200px;" placeholder="请选择判定结果" v-model="model.ybwg22v1">
                <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: 'CheckStepFourForm',
    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: '请输入sncode!'},
        ],
},
        url: {
          add: "/jianyan/checkStepFour/add",
          edit: "/jianyan/checkStepFour/edit",
          queryById: "/jianyan/checkStepFour/queryById"
        }
      }
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    },
    created () {
      this.modelDefault = JSON.parse(JSON.stringify(this.model));
    },
    methods: {
      add () {
        this.edit(this.modelDefault);
      },
      edit (record) {
         record= {
          ybwg1: '合格', ybwg1v1: 'Pass',
          ybwg2: '合格', ybwg2v1: 'Pass',
          ybwg3: '合格', ybwg3v1: 'Pass',
          ybwg4: '合格', ybwg4v1: 'Pass',
          ybwg5: '合格', ybwg5v1: 'Pass',
          ybwg6: '合格', ybwg6v1: 'Pass',
          ybwg7: '合格', ybwg7v1: 'Pass',
          ybwg8: '合格', ybwg8v1: 'Pass',
          ybwg9: '合格', ybwg9v1: 'Pass',
          ybwg10: '合格', ybwg10v1: 'Pass',
          ybwg11: '合格', ybwg11v1: 'Pass',
          ybwg12: '合格', ybwg12v1: 'Pass',
          ybwg13: '合格', ybwg13v1: 'Pass',
          ybwg14: '合格', ybwg14v1: 'Pass',
          ybwg15: '合格', ybwg15v1: 'Pass',
          ybwg16: '合格', ybwg16v1: 'Pass',
          ybwg17: '合格', ybwg17v1: 'Pass',
          ybwg18: '合格', ybwg18v1: 'Pass',
          ybwg19: '合格', ybwg19v1: 'Pass',
          ybwg20: '合格', ybwg20v1: 'Pass',
          ybwg21: '合格', ybwg21v1: 'Pass',
          ybwg22: '合格', ybwg22v1: 'Pass',
        }
        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>
<style>
.ant-col-sm-5 {
  display: block;
  box-sizing: border-box;
  width: 30.833333%;
}
</style>