| | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import { AddUpdateStepCheckItem, DeleteStepCheckItem, StepCheckItemSearch } from '@/api/zlgl' |
| | | import { validateCode } from '@/utils/global' |
| | | |
| | | const SER_HZ = /^[\u4e00-\u9fa5]+$/ |
| | | export default { |
| | | name: 'Xxxx', |
| | | components: { |
| | | Pagination |
| | | }, |
| | | data() { |
| | | const validateName = (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(new Error('请输入编码')) |
| | | } else { |
| | | if (SER_HZ.test(value)) { |
| | | return callback(new Error('编码不能为中文')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | } |
| | | return { |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | |
| | | operation: '', |
| | | dialogFormRules: { |
| | | checkitemcode: [ |
| | | { required: true, validator: validateName, trigger: ['blur', 'change'] } |
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] } |
| | | ], |
| | | checkitemname: [ |
| | | { required: true, message: '请输入名称', trigger: ['blur', 'change'] } |