Commit 431c195af9ecb03b5aeac4afa66deaa963bc5587
1 parent
96e46dfd
提交订阅
Showing
2 changed files
with
373 additions
and
2 deletions
src/components/jeecgbiz/JSelectUserByDep.vue
... | ... | @@ -91,14 +91,16 @@ |
91 | 91 | console.log("当前选中用户ID", idstr) |
92 | 92 | if (!rows) { |
93 | 93 | this.userNames = '' |
94 | - this.userIds = '' | |
94 | + this.userIds = [] | |
95 | 95 | } else { |
96 | 96 | let temp = '' |
97 | + let ids = [] | |
97 | 98 | for (let item of rows) { |
98 | 99 | temp += ',' + item.realname |
100 | + ids.push(item.id) | |
99 | 101 | } |
100 | 102 | this.userNames = temp.substring(1) |
101 | - this.userIds = idstr | |
103 | + this.userIds = ids | |
102 | 104 | } |
103 | 105 | this.$emit("change", this.userIds) |
104 | 106 | } |
... | ... |
src/views/system/modules/newsOrderPartCopy.vue
0 → 100644
1 | +<template> | |
2 | + <a-modal | |
3 | + :width="modalWidth" | |
4 | + :style="modalStyle" | |
5 | + :visible="visible" | |
6 | + :confirmLoading="confirmLoading" | |
7 | + :maskClosable="false" | |
8 | + @cancel="handleCancel"> | |
9 | + <template slot="footer"> | |
10 | + <a-button @click="handleCancel">关闭</a-button> | |
11 | + </template> | |
12 | + <a-spin :spinning="confirmLoading"> | |
13 | + <a-form :form="form"> | |
14 | + <a-row> | |
15 | + <a-col :span="24/3"> | |
16 | + <a-form-item label="工作令" :labelCol="labelCol" :wrapperCol="wrapperCol"> | |
17 | + <a-input v-decorator="['workNo']" disabled></a-input> | |
18 | + </a-form-item> | |
19 | + </a-col> | |
20 | + <a-col :span="24/3"> | |
21 | + <a-form-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol"> | |
22 | + <a-input v-decorator="['cno']" placeholder="请输入物料编码" disabled></a-input> | |
23 | + </a-form-item> | |
24 | + </a-col> | |
25 | + </a-row> | |
26 | + | |
27 | + <a-row> | |
28 | + <a-col :span="24/3"> | |
29 | + <a-form-item | |
30 | + :labelCol="labelCol" | |
31 | + :wrapperCol="wrapperCol" | |
32 | + label="采购" | |
33 | + hasFeedback> | |
34 | + <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose" v-model="visibleCheck"/> | |
35 | + </a-form-item> | |
36 | + </a-col> | |
37 | + | |
38 | + <a-col :span="24/3"> | |
39 | + <a-form-item | |
40 | + :labelCol="labelCol" | |
41 | + :wrapperCol="wrapperCol" | |
42 | + label="到货" | |
43 | + hasFeedback> | |
44 | + <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose2" v-model="visibleCheck2"/> | |
45 | + </a-form-item> | |
46 | + </a-col> | |
47 | + <a-col :span="24/3"> | |
48 | + <a-form-item | |
49 | + :labelCol="labelCol" | |
50 | + :wrapperCol="wrapperCol" | |
51 | + label="入库" | |
52 | + hasFeedback> | |
53 | + <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose3" v-model="visibleCheck3"/> | |
54 | + </a-form-item> | |
55 | + </a-col> | |
56 | + </a-row> | |
57 | + <a-row> | |
58 | + <a-col :span="24/3"> | |
59 | + <a-form-item | |
60 | + :labelCol="labelCol" | |
61 | + :wrapperCol="wrapperCol" | |
62 | + label="领料" | |
63 | + hasFeedback> | |
64 | + <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose4" v-model="visibleCheck4"/> | |
65 | + </a-form-item> | |
66 | + </a-col> | |
67 | + <a-col :span="24/3"> | |
68 | + <a-form-item | |
69 | + :labelCol="labelCol" | |
70 | + :wrapperCol="wrapperCol" | |
71 | + label="制作" | |
72 | + hasFeedback> | |
73 | + <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose5" v-model="visibleCheck5"/> | |
74 | + </a-form-item> | |
75 | + </a-col> | |
76 | + <a-col :span="24/3"> | |
77 | + <a-form-item | |
78 | + :labelCol="labelCol" | |
79 | + :wrapperCol="wrapperCol" | |
80 | + label="工艺" | |
81 | + hasFeedback> | |
82 | + <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose6" v-model="visibleCheck6"/> | |
83 | + </a-form-item> | |
84 | + </a-col> | |
85 | + </a-row> | |
86 | + | |
87 | + <!-- 通过部门选择用户控件 --> | |
88 | + <a-row :gutter="24"> | |
89 | + <a-col :span="12"> | |
90 | + <a-form-item label="选择订阅人员"> | |
91 | + <j-select-user-by-dep v-model="userIds" :multi="true"></j-select-user-by-dep> | |
92 | + </a-form-item> | |
93 | + </a-col> | |
94 | + </a-row> | |
95 | + | |
96 | + <a-row> | |
97 | + <a-col :span="24" style="text-align: center" class="table-page-search-submitButtons"> | |
98 | + <a-button type="primary" @click="submitForm" icon="check-circle">提 交</a-button> | |
99 | + </a-col> | |
100 | + </a-row> | |
101 | + | |
102 | + </a-form> | |
103 | + </a-spin> | |
104 | + </a-modal> | |
105 | +</template> | |
106 | + | |
107 | +<script> | |
108 | + | |
109 | +import {httpAction} from '@/api/manage' | |
110 | +import {JeecgListMixin} from '@/mixins/JeecgListMixin' | |
111 | +import pick from 'lodash.pick' | |
112 | + | |
113 | +export default { | |
114 | + name: 'PbomTypeForm', | |
115 | + mixins: [JeecgListMixin], | |
116 | + components: {}, | |
117 | + props: { | |
118 | + //流程表单data | |
119 | + formData: { | |
120 | + type: Object, | |
121 | + default: () => { | |
122 | + }, | |
123 | + required: false | |
124 | + }, | |
125 | + //表单模式:true流程表单 false普通表单 | |
126 | + formBpm: { | |
127 | + type: Boolean, | |
128 | + default: false, | |
129 | + required: false | |
130 | + }, | |
131 | + //表单禁用 | |
132 | + disabled: { | |
133 | + type: Boolean, | |
134 | + default: false, | |
135 | + required: false | |
136 | + } | |
137 | + }, | |
138 | + data() { | |
139 | + return { | |
140 | + visible: false, | |
141 | + modalWidth: '50%', | |
142 | + modalStyle: {'top': '20px'}, | |
143 | + form: this.$form.createForm(this), | |
144 | + excludeFlag: "", | |
145 | + visibleCheck: false, | |
146 | + excludeFlag2: "", | |
147 | + visibleCheck2: false, | |
148 | + excludeFlag3: "", | |
149 | + visibleCheck3: false, | |
150 | + excludeFlag4: "", | |
151 | + visibleCheck4: false, | |
152 | + excludeFlag5: "", | |
153 | + visibleCheck5: false, | |
154 | + excludeFlag6: "", | |
155 | + visibleCheck6: false, | |
156 | + model: {}, | |
157 | + no: '', | |
158 | + flag: false, | |
159 | + flag2: false, | |
160 | + labelCol: { | |
161 | + xs: {span: 24}, | |
162 | + sm: {span: 5}, | |
163 | + }, | |
164 | + wrapperCol: { | |
165 | + xs: {span: 24}, | |
166 | + sm: {span: 16}, | |
167 | + }, | |
168 | + confirmLoading: false, | |
169 | + validatorRules: {}, | |
170 | + searchOptions: [{ | |
171 | + text: "外协", | |
172 | + value: "外协" | |
173 | + }, { | |
174 | + text: "自制", | |
175 | + value: "自制" | |
176 | + }, { | |
177 | + text: "外购", | |
178 | + value: "外购" | |
179 | + }, { | |
180 | + text: "工序外协", | |
181 | + value: "工序外协" | |
182 | + }], | |
183 | + url: { | |
184 | + list: "1", | |
185 | + add: "/news/userNewsOrder/addUserNewsOrders", | |
186 | + edit: "/pbom_type/pbomType/edit", | |
187 | + queryById: "/pbom_type/pbomType/queryById" | |
188 | + } | |
189 | + } | |
190 | + }, | |
191 | + computed: { | |
192 | + formDisabled() { | |
193 | + if (this.formBpm === true) { | |
194 | + if (this.formData.disabled === false) { | |
195 | + return false | |
196 | + } | |
197 | + return true | |
198 | + } | |
199 | + return this.disabled | |
200 | + }, | |
201 | + showFlowSubmitButton() { | |
202 | + if (this.formBpm === true) { | |
203 | + if (this.formData.disabled === false) { | |
204 | + return true | |
205 | + } | |
206 | + } | |
207 | + return false | |
208 | + }, | |
209 | + | |
210 | + }, | |
211 | + created() { | |
212 | + //如果是流程中表单,则需要加载流程表单data | |
213 | + this.showFlowData(); | |
214 | + }, | |
215 | + methods: { | |
216 | + add() { | |
217 | + this.edit({}); | |
218 | + }, | |
219 | + edit(record, workNo) { | |
220 | + this.visible = true; | |
221 | + this.form.resetFields(); | |
222 | + this.no = record.cno; | |
223 | + this.model = Object.assign({}, record); | |
224 | + this.visible = true; | |
225 | + this.$nextTick(() => { | |
226 | + this.form.setFieldsValue(pick(this.model, 'cno', 'uuid', 'f04', 'code')) | |
227 | + this.form.setFieldsValue({ | |
228 | + workNo: workNo | |
229 | + }) | |
230 | + }) | |
231 | + if (record.purchase == '1') { | |
232 | + this.visibleCheck = true | |
233 | + } else { | |
234 | + this.visibleCheck = false | |
235 | + } | |
236 | + if (record.arrival == '1') { | |
237 | + this.visibleCheck2 = true | |
238 | + } else { | |
239 | + this.visibleCheck2 = false | |
240 | + } | |
241 | + if (record.warehousing == '1') { | |
242 | + this.visibleCheck3 = true | |
243 | + } else { | |
244 | + this.visibleCheck3 = false | |
245 | + } | |
246 | + if (record.picking == '1') { | |
247 | + this.visibleCheck4 = true | |
248 | + } else { | |
249 | + this.visibleCheck4 = false | |
250 | + } | |
251 | + if (record.make == '1') { | |
252 | + this.visibleCheck5 = true | |
253 | + } else { | |
254 | + this.visibleCheck5 = false | |
255 | + } | |
256 | + if (record.craft == '1') { | |
257 | + this.visibleCheck6 = true | |
258 | + } else { | |
259 | + this.visibleCheck6 = false | |
260 | + } | |
261 | + }, | |
262 | + handleCancel() { | |
263 | + this.visible = false | |
264 | + }, | |
265 | + | |
266 | + onChose(checked) { | |
267 | + if (checked) { | |
268 | + this.excludeFlag = 1 | |
269 | + this.visibleCheck = true | |
270 | + } else { | |
271 | + this.excludeFlag = 0 | |
272 | + this.visibleCheck = false | |
273 | + } | |
274 | + }, | |
275 | + | |
276 | + onChose2(checked) { | |
277 | + if (checked) { | |
278 | + this.excludeFlag2 = 1 | |
279 | + this.visibleCheck2 = true | |
280 | + } else { | |
281 | + this.excludeFlag2 = 0 | |
282 | + this.visibleCheck2 = false | |
283 | + } | |
284 | + }, | |
285 | + | |
286 | + onChose3(checked) { | |
287 | + if (checked) { | |
288 | + this.excludeFlag3 = 1 | |
289 | + this.visibleCheck3 = true | |
290 | + } else { | |
291 | + this.excludeFlag3 = 0 | |
292 | + this.visibleCheck3 = false | |
293 | + } | |
294 | + }, | |
295 | + | |
296 | + onChose4(checked) { | |
297 | + if (checked) { | |
298 | + this.excludeFlag4 = 1 | |
299 | + this.visibleCheck4 = true | |
300 | + } else { | |
301 | + this.excludeFlag4 = 0 | |
302 | + this.visibleCheck4 = false | |
303 | + } | |
304 | + }, | |
305 | + | |
306 | + onChose5(checked) { | |
307 | + if (checked) { | |
308 | + this.excludeFlag5 = 1 | |
309 | + this.visibleCheck5 = true | |
310 | + } else { | |
311 | + this.excludeFlag5 = 0 | |
312 | + this.visibleCheck5 = false | |
313 | + } | |
314 | + }, | |
315 | + | |
316 | + onChose6(checked) { | |
317 | + if (checked) { | |
318 | + this.excludeFlag6 = 1 | |
319 | + this.visibleCheck6 = true | |
320 | + } else { | |
321 | + this.excludeFlag6 = 0 | |
322 | + this.visibleCheck6 = false | |
323 | + } | |
324 | + }, | |
325 | + | |
326 | + submitForm() { | |
327 | + const that = this; | |
328 | + console.log("当前选中用户?????", that.userIds) | |
329 | + | |
330 | + // 触发表单验证 | |
331 | + this.form.validateFields((err, values) => { | |
332 | + if (!err) { | |
333 | + that.confirmLoading = true; | |
334 | + let httpurl = ''; | |
335 | + let method = ''; | |
336 | + httpurl += this.url.add; | |
337 | + method = 'post'; | |
338 | + let formData = Object.assign(this.model, values); | |
339 | + formData.no = this.no | |
340 | + formData.purchase = this.excludeFlag | |
341 | + formData.arrival = this.excludeFlag2 | |
342 | + formData.warehousing = this.excludeFlag3 | |
343 | + formData.picking = this.excludeFlag4 | |
344 | + formData.make = this.excludeFlag5 | |
345 | + formData.craft = this.excludeFlag6 | |
346 | + formData.userIds = that.userIds | |
347 | + httpAction(httpurl, formData, method).then((res) => { | |
348 | + if (res.success) { | |
349 | + that.$message.success(res.message); | |
350 | + this.visible = false | |
351 | + that.$emit('ok'); | |
352 | + that.$emit('fatherMethod', ''); | |
353 | + | |
354 | + } else { | |
355 | + that.$message.warning(res.message); | |
356 | + } | |
357 | + }).finally(() => { | |
358 | + that.confirmLoading = false; | |
359 | + }) | |
360 | + } | |
361 | + | |
362 | + }) | |
363 | + }, | |
364 | + popupCallback(row) { | |
365 | + this.form.setFieldsValue(pick(row, 'cno', 'uuid', 'f04', 'code')) | |
366 | + }, | |
367 | + } | |
368 | +} | |
369 | +</script> | |
0 | 370 | \ No newline at end of file |
... | ... |