Merge branch 'master' of http://yun.pashanhoo.com:9090/bdc/bdcdj-web
Showing
2 changed files
with
365 additions
and
1 deletions
src/views/workflow/components/spyj copy.vue
0 → 100644
1 | <!-- | ||
2 | * @Description: 审批意见 | ||
3 | * @Autor: renchao | ||
4 | * @LastEditTime: 2023-08-16 14:39:55 | ||
5 | --> | ||
6 | <template> | ||
7 | <div class="spyj loadingtext"> | ||
8 | <div class="box"> | ||
9 | <div class="spyj_title"> | ||
10 | <div class="righttitle">审批表</div> | ||
11 | </div> | ||
12 | |||
13 | <div v-for="(item, index) in tableData" :key="index"> | ||
14 | <el-form | ||
15 | :model="tableData[index]" | ||
16 | label-width="120px" | ||
17 | ref="ruleForm'" | ||
18 | > | ||
19 | <div class="spyj_form"> | ||
20 | <div class="item_left"> | ||
21 | <div class="right">{{ item.jdmc }}意见</div> | ||
22 | </div> | ||
23 | <div class="item_right"> | ||
24 | <el-row> | ||
25 | <el-col :span="24"> | ||
26 | <el-form-item | ||
27 | label-width="0" | ||
28 | class="opinion_item" | ||
29 | > | ||
30 | <el-input | ||
31 | :disabled="!viewEdit || item.show" | ||
32 | type="textarea" | ||
33 | :rows="4" | ||
34 | class="opinion" | ||
35 | placeholder="请输入审批意见" | ||
36 | v-model="item.shyj" | ||
37 | ></el-input> | ||
38 | <el-button | ||
39 | class="opinion_btn" | ||
40 | @click="commonOpinion(index)" | ||
41 | :disabled="!viewEdit|| item.show" | ||
42 | >常用意见</el-button | ||
43 | > | ||
44 | </el-form-item> | ||
45 | </el-col> | ||
46 | </el-row> | ||
47 | <el-row> | ||
48 | <el-col :span="16"> | ||
49 | <el-form-item label="审查人"> | ||
50 | {{ item.shryxm }} | ||
51 | </el-form-item> | ||
52 | </el-col> | ||
53 | <el-col :span="8"> | ||
54 | <el-form-item disabled label="审核时间" :key="refresh"> | ||
55 | {{ item.shjssj }} | ||
56 | </el-form-item> | ||
57 | </el-col> | ||
58 | </el-row> | ||
59 | </div> | ||
60 | </div> | ||
61 | </el-form> | ||
62 | </div> | ||
63 | <div class="submit_button" v-if="viewEdit"> | ||
64 | <el-button type="primary" :disabled="shows" @click="onSubmit()" | ||
65 | >保存</el-button | ||
66 | > | ||
67 | </div> | ||
68 | </div> | ||
69 | <!-- <el-empty v-if="isNoData" description="暂无数据"></el-empty> --> | ||
70 | </div> | ||
71 | </template> | ||
72 | <script> | ||
73 | import { saveSpyjBySlsq, getSpyjList } from "@/api/opinion.js"; | ||
74 | import { mapGetters } from "vuex"; | ||
75 | import { getNewDatesh } from "@/utils/util"; | ||
76 | export default { | ||
77 | computed: { | ||
78 | ...mapGetters(["userData", "yjsqOptions", "userInfo"]), | ||
79 | }, | ||
80 | data() { | ||
81 | return { | ||
82 | isNoData: false, | ||
83 | currentindex: 0, | ||
84 | bsmSlsq: "", | ||
85 | refresh: 10, | ||
86 | viewEdit: false, | ||
87 | bsmSlsq: this.$route.query.bsmSlsq, | ||
88 | bestepid: this.$route.query.bestepid, | ||
89 | propsParam: {}, | ||
90 | tableData: [], | ||
91 | falg: false, | ||
92 | falg1: false, | ||
93 | jdmc: "", | ||
94 | indexdqlc: 0, | ||
95 | shows: false, | ||
96 | }; | ||
97 | }, | ||
98 | |||
99 | watch: { | ||
100 | yjsqOptions: { | ||
101 | handler(val) { | ||
102 | this.add(val); | ||
103 | }, | ||
104 | deep: true, | ||
105 | immediate: true, | ||
106 | }, | ||
107 | }, | ||
108 | created() {}, | ||
109 | mounted() { | ||
110 | this.propsParam = this.$attrs; | ||
111 | this.viewEdit = this.$parent.currentSelectTab.ableOperation; | ||
112 | this.getShList(); | ||
113 | |||
114 | switch (this.$parent.dqhj) { | ||
115 | case "cs": | ||
116 | this.indexdqlc = 0; | ||
117 | this.jdmc = "初审"; | ||
118 | break; | ||
119 | case "fs": | ||
120 | this.indexdqlc = 1; | ||
121 | this.jdmc = "复审"; | ||
122 | break; | ||
123 | case "hd": | ||
124 | this.indexdqlc = 2; | ||
125 | this.jdmc = "核定"; | ||
126 | break; | ||
127 | } | ||
128 | }, | ||
129 | methods: { | ||
130 | /** | ||
131 | * @description: getShList | ||
132 | * @param {*} obj | ||
133 | * @author: renchao | ||
134 | */ | ||
135 | getShList() { | ||
136 | this.$startLoading(); | ||
137 | var formdata = new FormData(); | ||
138 | formdata.append("bsmBusiness", this.propsParam.bsmBusiness); | ||
139 | formdata.append("bestepid", this.$route.query.bestepid); | ||
140 | |||
141 | getSpyjList(formdata).then((res) => { | ||
142 | this.$endLoading(); | ||
143 | if (res.code === 200 && res.result) { | ||
144 | this.$nextTick(() => { | ||
145 | this.tableData = res.result; | ||
146 | if (this.shows) { | ||
147 | this.shows = false; | ||
148 | } | ||
149 | |||
150 | var index = this.tableData.findIndex( | ||
151 | (item) => item.jddm === this.$parent.dqhj | ||
152 | ); | ||
153 | if (index == -1) { | ||
154 | switch (this.$parent.dqhj) { | ||
155 | case "cs": | ||
156 | this.tableData.push({ jdmc: "初审", jddm: "cs", sxh: 1 }); | ||
157 | break; | ||
158 | case "fs": | ||
159 | this.tableData.push({ jdmc: "复审", jddm: "fs", sxh: 2 }); | ||
160 | break; | ||
161 | case "hd": | ||
162 | this.tableData.push({ jdmc: "核定", jddm: "hd", sxh: 3 }); | ||
163 | break; | ||
164 | } | ||
165 | } | ||
166 | this.tableData.forEach((item) => { | ||
167 | item.show = true; | ||
168 | if (this.$parent.dqhj == item.jddm) { | ||
169 | item["stepid"] = this.$route.query.bestepid; | ||
170 | item.shjssj = getNewDatesh(); | ||
171 | item.shkssj = getNewDatesh(); | ||
172 | item["shryxm"] = this.userInfo.name; | ||
173 | item["userid"] = this.userInfo.id; | ||
174 | item.show = false; | ||
175 | } | ||
176 | }); | ||
177 | }); | ||
178 | } | ||
179 | }); | ||
180 | }, | ||
181 | /** | ||
182 | * @description: judgment | ||
183 | * @param {*} obj | ||
184 | * @author: renchao | ||
185 | */ | ||
186 | judgment(obj) {}, | ||
187 | /** | ||
188 | * @description: onSubmit | ||
189 | * @author: renchao | ||
190 | */ | ||
191 | onSubmit() { | ||
192 | |||
193 | this.tableData.forEach((item, index) => { | ||
194 | item["bsmBusiness"] = this.propsParam.bsmBusiness; | ||
195 | item["czjg"] = "1"; | ||
196 | }); | ||
197 | var index = this.tableData.findIndex( | ||
198 | (item) => item.shyj === null||item.shyj === "" | ||
199 | ); | ||
200 | if(index==-1){ | ||
201 | this.shows = true; | ||
202 | saveSpyjBySlsq(this.tableData).then((res) => { | ||
203 | if (res.code === 200) { | ||
204 | this.$message.success("保存成功"); | ||
205 | this.refresh += 1; | ||
206 | this.getShList(); | ||
207 | } else { | ||
208 | this.$message.error(res.message); | ||
209 | } | ||
210 | }); | ||
211 | }else{ | ||
212 | this.$message.error("意见不能为空"); | ||
213 | } | ||
214 | |||
215 | }, | ||
216 | //打开常用意见列表弹窗 | ||
217 | /** | ||
218 | * @description: 打开常用意见列表弹窗 | ||
219 | * @param {*} index | ||
220 | * @author: renchao | ||
221 | */ | ||
222 | commonOpinion(index) { | ||
223 | this.currentindex = index; | ||
224 | this.$popupDialog( | ||
225 | "常用意见", | ||
226 | "workflow/components/dialog/commonOpinion", | ||
227 | {}, | ||
228 | "70%", | ||
229 | true | ||
230 | ); | ||
231 | }, | ||
232 | /** | ||
233 | * @description: add | ||
234 | * @param {*} val | ||
235 | * @author: renchao | ||
236 | */ | ||
237 | add(val) { | ||
238 | if (val != "") { | ||
239 | this.$set(this.tableData[this.currentindex], "shyj", val); | ||
240 | } | ||
241 | }, | ||
242 | }, | ||
243 | }; | ||
244 | </script> | ||
245 | <style scoped lang="scss"> | ||
246 | @import "~@/styles/mixin.scss"; | ||
247 | |||
248 | .spyj { | ||
249 | width: 100%; | ||
250 | height: 100%; | ||
251 | background-color: #f5f5f5; | ||
252 | padding: 5px; | ||
253 | .box { | ||
254 | overflow-x: auto; | ||
255 | width: 100%; | ||
256 | height: 95%; | ||
257 | background: #fff; | ||
258 | text-align: center; | ||
259 | padding: 4px; | ||
260 | overflow-y: scroll; | ||
261 | padding-top: 20px; | ||
262 | padding: 20px 40px; | ||
263 | .spyj_title { | ||
264 | width: 100%; | ||
265 | height: 80px; | ||
266 | border: 1px solid $borderColor; | ||
267 | background-color: #eceef2; | ||
268 | display: flex; | ||
269 | } | ||
270 | .leftadd { | ||
271 | width: 3%; | ||
272 | height: 100%; | ||
273 | display: flex; | ||
274 | font-size: 14px; | ||
275 | text-indent: 20px; | ||
276 | align-items: center; | ||
277 | border: 1px solid $borderColor; | ||
278 | } | ||
279 | .righttitle { | ||
280 | width: 80%; | ||
281 | height: 100%; | ||
282 | line-height: 80px; | ||
283 | border: 1px solid $borderColor; | ||
284 | margin: auto; | ||
285 | font-size: 22px; | ||
286 | font-weight: 400; | ||
287 | } | ||
288 | } | ||
289 | |||
290 | /deep/.el-form-item { | ||
291 | margin-bottom: 0; | ||
292 | } | ||
293 | |||
294 | .bottom10 { | ||
295 | margin-bottom: 15px; | ||
296 | } | ||
297 | |||
298 | .spyj_form { | ||
299 | display: flex; | ||
300 | border: 1px solid $borderColor; | ||
301 | |||
302 | .item_left { | ||
303 | width: 150px; | ||
304 | background-color: #f8f8fa; | ||
305 | color: #606266; | ||
306 | display: flex; | ||
307 | font-size: 14px; | ||
308 | text-indent: 50px; | ||
309 | align-items: center; | ||
310 | border-right: 1px solid $borderColor; | ||
311 | } | ||
312 | |||
313 | .item_right { | ||
314 | flex: 1; | ||
315 | width: 100%; | ||
316 | |||
317 | /deep/.el-form-item__label { | ||
318 | background-color: #f8f8fa; | ||
319 | } | ||
320 | /deep/.el-form-item__content { | ||
321 | display: block; | ||
322 | text-align: left; | ||
323 | } | ||
324 | .opinion_item { | ||
325 | /deep/.el-form-item__error { | ||
326 | margin-top: -16px !important; | ||
327 | left: 3px; | ||
328 | } | ||
329 | border-bottom: 1px solid $borderColor; | ||
330 | } | ||
331 | |||
332 | .opinion { | ||
333 | position: relative; | ||
334 | font-size: 14px; | ||
335 | |||
336 | /deep/.el-textarea__inner { | ||
337 | border: none; | ||
338 | } | ||
339 | } | ||
340 | |||
341 | .opinion_btn { | ||
342 | position: absolute; | ||
343 | right: 15px; | ||
344 | bottom: 10px; | ||
345 | } | ||
346 | } | ||
347 | } | ||
348 | |||
349 | .submit_button { | ||
350 | text-align: center; | ||
351 | margin: 15px 0; | ||
352 | } | ||
353 | |||
354 | .el-date-editor.el-input { | ||
355 | width: 100%; | ||
356 | } | ||
357 | } | ||
358 | </style> |
... | @@ -139,7 +139,7 @@ export default { | ... | @@ -139,7 +139,7 @@ export default { |
139 | formdata.append("bestepid", this.$route.query.bestepid); | 139 | formdata.append("bestepid", this.$route.query.bestepid); |
140 | 140 | ||
141 | getSpyjList(formdata).then((res) => { | 141 | getSpyjList(formdata).then((res) => { |
142 | this.$endLoading(); | 142 | |
143 | if (res.code === 200 && res.result) { | 143 | if (res.code === 200 && res.result) { |
144 | this.$nextTick(() => { | 144 | this.$nextTick(() => { |
145 | this.tableData = res.result; | 145 | this.tableData = res.result; |
... | @@ -150,6 +150,7 @@ export default { | ... | @@ -150,6 +150,7 @@ export default { |
150 | var index = this.tableData.findIndex( | 150 | var index = this.tableData.findIndex( |
151 | (item) => item.jddm === this.$parent.dqhj | 151 | (item) => item.jddm === this.$parent.dqhj |
152 | ); | 152 | ); |
153 | console.log("this.tableData111",this.tableData); | ||
153 | if (index == -1) { | 154 | if (index == -1) { |
154 | switch (this.$parent.dqhj) { | 155 | switch (this.$parent.dqhj) { |
155 | case "cs": | 156 | case "cs": |
... | @@ -162,6 +163,7 @@ export default { | ... | @@ -162,6 +163,7 @@ export default { |
162 | this.tableData.push({ jdmc: "核定", jddm: "hd", sxh: 3 }); | 163 | this.tableData.push({ jdmc: "核定", jddm: "hd", sxh: 3 }); |
163 | break; | 164 | break; |
164 | } | 165 | } |
166 | console.log("this.tableData222",this.tableData); | ||
165 | } | 167 | } |
166 | this.tableData.forEach((item) => { | 168 | this.tableData.forEach((item) => { |
167 | item.show = true; | 169 | item.show = true; |
... | @@ -173,9 +175,13 @@ export default { | ... | @@ -173,9 +175,13 @@ export default { |
173 | item["userid"] = this.userInfo.id; | 175 | item["userid"] = this.userInfo.id; |
174 | item.show = false; | 176 | item.show = false; |
175 | } | 177 | } |
178 | console.log("this.tableData333",this.tableData); | ||
176 | }); | 179 | }); |
180 | console.log("this.tableData444",this.tableData); | ||
181 | this.$endLoading(); | ||
177 | }); | 182 | }); |
178 | } | 183 | } |
184 | |||
179 | }); | 185 | }); |
180 | }, | 186 | }, |
181 | /** | 187 | /** | ... | ... |
-
Please register or sign in to post a comment