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
| <template>
| <el-dialog :close-on-click-modal="false" :visible.sync="islook" width="35rem" class="add-rule-set-dialog"
| @close="shutdown">
| <div slot="title" class="tac drawerHeader">{{ title }}</div>
| <div class="dialog-content-box">
| <el-form ref="form" class="form-box" :rules="rules"
| :model="form"
| label-width="150px"
| label-position="right">
| <el-form-item v-if="constType==2" label="缺勤超过" label-width="100px" prop="cycle">
|
| <el-input
| style="width:calc(100% - 150px)"
| class="margin_left_5px margin_right_5px"
| v-model="form.cycle"
| placeholder="请输入"></el-input>
| 天则满勤奖全额扣除
| </el-form-item>
| <el-form-item v-if="constType==3" label="请输入常量数值" label-width="150px" prop="number">
| <el-input
| v-model="form.number"
| class="margin_left_5px"
| placeholder="请输入"></el-input>
| </el-form-item>
| </el-form>
| </div>
| <div slot="footer" class="dialog-footer tac">
| <el-button @click="shutdown">取消</el-button>
| <el-button type="primary" @click="onSubmit(form)">确定</el-button>
| </div>
| </el-dialog>
| </template>
|
| <script>
| export default {
| props: {
| constType:{
| type:[Number,String],
| default:''
| },
| title:{
| type:[String,Number],
| default:''
| },
| editRow:{
| type:[Object],
| }
| },
| data() {
| return {
| islook: false,
| form: {
| cycle:1,
| number:'',
| },
| rules: {
| cycle: [
| {
| required: true,
| message: "请输入",
| trigger: "blur",
| },
| {
| validator: this.validatorNum,
| trigger: "blur",
| },
| ],
| number: [
| {
| required: true,
| message: "请输入",
| trigger: "blur",
| },
| {
| validator: this.validatorNum,
| trigger: "blur",
| },
| ],
| },
| procedureIdsList: [],
| };
| },
| mounted() {
| },
| watch: {
| islook(newVal) {
| if (newVal) {
| this.$nextTick(() => {
| this.$refs["form"].resetFields();
| });
| this.form.cycle=this.editRow.cycle
| this.form.number=null
| }
| },
| },
| methods: {
| validatorNum(rule, value, callback) {
| if (value) {
| if (value == undefined || value == null) {
| callback(new Error("请输入有效数字"));
| } else {
| let reg2 =
| /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
| if (!reg2.test(value)) {
| callback(new Error("请填写2位小数的数字"));
| } else {
| callback();
| }
| }
| } else {
| callback();
| }
| },
| onSubmit() {
| this.$refs.form.validate((valid) => {
| if (valid) {
| this.$emit('confirmValueSave',this.form,this.constType)
| this.shutdown()
| }
| });
| },
| shutdown() {
| this.islook = false;
| },
| },
| };
| </script>
|
| <style lang="scss" scoped>
| .add-rule-set-dialog {
| .form-box {
| width:94%;
| .el-form-item {
| width: 100%;
| .el-radio{
| height:40px;
| line-height:40px;
| }
| }
| }
| }
|
|
| ::v-deep .el-input__inner {
| font-size: 13px !important;
| color: rgba(0, 0, 0, 0.9);
| text-align: left;
| }
| </style>
|
|