123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <template>
- <el-row>
- <el-col :span="24">
- <el-form
- :model="assayForm"
- ref="assayForm"
- class="sub-form"
- :validate-on-rule-change="false"
- >
- <el-form-item label="特殊性" label-width="110px">
- <el-select
- v-model="assayForm.special"
- placeholder="请选择特殊性"
- clearable
- @change="handleValue('special')"
- style="width: 100%"
- ref="special"
- >
- <el-option label="是" value="是"></el-option>
- <el-option label="否" value="否"></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- </el-col>
- </el-row>
- </template>
- <script>
- export default {
- name: 'AssayForm',
- props: ['data'],
- data() {
- // let checkFrequency = (rule, value, callback) => {
- // let special = this.$refs.special.value;
- // if (special === '' || special === null) {
- // callback('请选择特殊');
- // } else {
- // callback();
- // }
- // };
- return {
- assayForm: {
- special: ''
- },
- // rules: {
- // special: [
- // {
- // required: true,
- // validator: checkFrequency,
- // trigger: ['blur', 'change']
- // }
- // ]
- // }
- };
- },
- computed: {},
- created() {
- this._initData();
- },
- mounted() {},
- methods: {
- _initData() {
- this.assayForm.special = this.data.special;
- },
- // 传值
- handleValue(from) {
- this.$emit('handleInput', {
- type: from,
- value: this.assayForm[from]
- });
- }
- }
- };
- </script>
- <style lang="less" scoped>
- </style>
|