spyj.vue
5.84 KB
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!--
* @Description: 审批意见
* @Autor: renchao
* @LastEditTime: 2023-05-17 10:41:24
-->
<template>
<div class="spyj loadingtext">
<div class="box">
<b class="spyj_title">审批表</b>
<div v-for="(item, index) in tableData" :key="index">
<el-form :model="tableData[index]" label-width="120px" :rules="rules" :ref="'ruleFormRef'+index">
<div class="spyj_form" >
<div class="item_left">{{ item.jdmc }}意见</div>
<div class="item_right">
<el-row>
<el-col :span="24">
<el-form-item
label-width="0"
class="opinion_item"
prop="shyj"
>
<el-input
type="textarea"
:rows="4"
class="opinion"
placeholder="请输入审批意见"
v-model="item.shyj"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16">
<el-form-item
label="审查人"
prop="shryxm"
>
<el-input v-model="item.shryxm"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
label="审核时间"
prop="shsj"
>
<el-date-picker
v-model="item.shsj"
type="date"
placeholder="选择日期"
value-format="yyyy/MM/dd HH:mm:ss"
format="yyyy/MM/dd"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</div>
</div>
</el-form>
</div>
<div class="submit_button" v-if="!$route.query.viewtype">
<el-button type="primary" @click="onSubmit('ruleFormRef')">保存</el-button>
</div>
</div>
<!-- <el-empty v-if="isNoData" description="暂无数据"></el-empty> -->
</div>
</template>
<script>
import { addidea } from "@/api/djbbl.js";
import { mapGetters } from "vuex";
export default {
computed: {
...mapGetters(["userData", "yjsqOptions"]),
},
data() {
return {
isNoData: false,
ableOperation: true,
tableData: [{ jdmc: "初审" }, { jdmc: "复审" }, { jdmc: "核定" }],
rules: {
shyj: [{ required: true, message: "请填写意见", trigger: "blur" }],
shryxm: [{ required: true, message: "审查人", trigger: "blur" }],
shsj: [{ required: true, message: "审核时间", trigger: "blur" }],
},
};
},
watch: {},
created() {},
mounted() {},
methods: {
onSubmit(formName) {
const falg = []
for (let index = 0; index < this.tableData.length; index++) {
this.$refs[formName + index][0].validate((valid) => {
if (valid) {
falg.push(1)
}
});
}
if (falg.length == this.tableData.length) {
this.tableData.forEach((item, index) => {
item["bsmBusiness"] = this.$parent.bsmRepair;
}),
addidea(this.tableData).then((res) => {
if (res.code === 200) {
this.$message.success("保存成功");
this.refresh += 1;
} else {
this.$message.error(res.message);
}
});
} else {
return false;
}
},
// onSubmit() {
// this.$refs.tablelist[index].validate((valid) => {
// if (valid) {
// this.tableData.forEach((item, index) => {
// item["bsmBusiness"] = this.$parent.bsmRepair;
// }),
// addidea(this.tableData).then((res) => {
// if (res.code === 200) {
// this.$message.success("保存成功");
// this.refresh += 1;
// } else {
// this.$message.error(res.message);
// }
// });
// }
// });
// },
},
};
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
.spyj {
width: 100%;
height: 100%;
background-color: #f5f5f5;
padding: 5px;
.box {
overflow-x: auto;
width: 100%;
height: 95%;
background: #fff;
text-align: center;
padding: 4px;
overflow-y: scroll;
padding-top: 20px;
padding: 20px 40px;
}
.spyj_title {
line-height: 68px;
border: 1px solid $borderColor;
text-align: center;
font-size: 22px;
font-weight: 400;
background-color: #eceef2;
display: block;
border-bottom: none;
}
/deep/.el-form-item {
margin-bottom: 0;
}
.bottom10 {
margin-bottom: 15px;
}
.spyj_form {
display: flex;
border: 1px solid $borderColor;
.item_left {
width: 150px;
background-color: #f8f8fa;
color: #606266;
display: flex;
font-size: 14px;
text-indent: 80px;
align-items: center;
border-right: 1px solid $borderColor;
}
.item_right {
flex: 1;
width: 100%;
/deep/.el-form-item__label {
background-color: #f8f8fa;
}
/deep/.el-form-item__content {
display: block;
text-align: left;
text-indent: 10px;
}
.opinion_item {
/deep/.el-form-item__error {
margin-top: -16px !important;
left: 3px;
}
border-bottom: 1px solid $borderColor;
}
.opinion {
position: relative;
font-size: 14px;
/deep/.el-textarea__inner {
border: none;
}
}
.opinion_btn {
position: absolute;
right: 15px;
bottom: 10px;
}
}
}
.submit_button {
text-align: center;
margin: 15px 0;
}
}
</style>