|
|
@@ -0,0 +1,710 @@
|
|
|
1
|
+<script setup>
|
|
|
2
|
+import { getCurrentInstance, onMounted, ref , computed } from 'vue';
|
|
|
3
|
+import { useRoute, useRouter } from 'vue-router';
|
|
|
4
|
+import tools from '@/tools'
|
|
|
5
|
+
|
|
|
6
|
+const {
|
|
|
7
|
+ proxy
|
|
|
8
|
+} = getCurrentInstance()
|
|
|
9
|
+const accidentDictList = ref([])
|
|
|
10
|
+const columns = ref([])
|
|
|
11
|
+const columnsLevel = ref([])
|
|
|
12
|
+const columnsprimary=ref([])
|
|
|
13
|
+
|
|
|
14
|
+// [
|
|
|
15
|
+// { text: '杭州', value: 'Hangzhou' },
|
|
|
16
|
+// { text: '宁波', value: 'Ningbo' },
|
|
|
17
|
+// { text: '温州', value: 'Wenzhou' },
|
|
|
18
|
+// { text: '绍兴', value: 'Shaoxing' },
|
|
|
19
|
+// { text: '湖州', value: 'Huzhou' },
|
|
|
20
|
+// ];
|
|
|
21
|
+
|
|
|
22
|
+// 定义生成编号的函数(你已写好的逻辑)
|
|
|
23
|
+
|
|
|
24
|
+const generateCode = () => {
|
|
|
25
|
+ const now = new Date();
|
|
|
26
|
+ const year = now.getFullYear();
|
|
|
27
|
+ const month = String(now.getMonth() + 1).padStart(2, '0');
|
|
|
28
|
+ const day = String(now.getDate()).padStart(2, '0');
|
|
|
29
|
+ const formattedDate = `${year}${month}${day}`;
|
|
|
30
|
+ const hours = String(now.getHours()).padStart(2, '0');
|
|
|
31
|
+ const minutes = String(now.getMinutes()).padStart(2, '0');
|
|
|
32
|
+ const seconds = String(now.getSeconds()).padStart(2, '0');
|
|
|
33
|
+ const formattedTime = `${hours}${minutes}${seconds}`;
|
|
|
34
|
+ const sequenceNumber = Math.floor(Math.random() * 1000);
|
|
|
35
|
+ const paddedSequence = String(sequenceNumber).padStart(3, '0');
|
|
|
36
|
+ return `SGAL${formattedDate}${formattedTime}${paddedSequence}`;
|
|
|
37
|
+};
|
|
|
38
|
+
|
|
|
39
|
+// 存储生成的编号(响应式变量)
|
|
|
40
|
+const generatedCode = ref('');
|
|
|
41
|
+
|
|
|
42
|
+// 重新生成编号的方法
|
|
|
43
|
+const regenerateCode = () => {
|
|
|
44
|
+ generatedCode.value = generateCode();
|
|
|
45
|
+};
|
|
|
46
|
+
|
|
|
47
|
+
|
|
|
48
|
+
|
|
|
49
|
+const getAccidentDicList = () => {
|
|
|
50
|
+ tools.dic.getDicList([ 'case_type','sgsafe_culture_case_type', 'case_source','primary_domain','primary_domain_two','accident_level','accident_type','sgsafe_taccidentTags','sgsafe_culture_activity_type']).then((response => {
|
|
|
51
|
+ console.log(JSON.stringify(response.data.data))
|
|
|
52
|
+ accidentDictList.value = response.data.data
|
|
|
53
|
+ console.log('case_source',accidentDictList.value.case_source)
|
|
|
54
|
+ columns.value = accidentDictList.value.sgsafe_culture_case_type.map(item => ({
|
|
|
55
|
+ text: item.dicName,
|
|
|
56
|
+ value: item.dicCode
|
|
|
57
|
+ }));
|
|
|
58
|
+ columnsLevel.value = accidentDictList.value.sgsafe_culture_activity_type.map(item => ({
|
|
|
59
|
+ text: item.dicName,
|
|
|
60
|
+ value: item.dicCode
|
|
|
61
|
+ }));
|
|
|
62
|
+ columnsprimary.value = accidentDictList.value.primary_domain.map(item => ({
|
|
|
63
|
+ text: item.dicName,
|
|
|
64
|
+ value: item.dicCode
|
|
|
65
|
+ }));
|
|
|
66
|
+
|
|
|
67
|
+
|
|
|
68
|
+ console.log('accident_level',accidentDictList.value.accident_level)
|
|
|
69
|
+
|
|
|
70
|
+ }))
|
|
|
71
|
+}
|
|
|
72
|
+
|
|
|
73
|
+
|
|
|
74
|
+const caseSourceFlag = ref(false)
|
|
|
75
|
+const accidentLevelFlag = ref(false)
|
|
|
76
|
+const primaryDomainFlag = ref(false)
|
|
|
77
|
+const primaryDomainTwoFlag = ref(false)
|
|
|
78
|
+let title = '新增事故案例'
|
|
|
79
|
+
|
|
|
80
|
+/* 返回上一级页面 */
|
|
|
81
|
+const router = useRouter()
|
|
|
82
|
+const onClickLeft = () => {
|
|
|
83
|
+ router.go(-1)
|
|
|
84
|
+}
|
|
|
85
|
+
|
|
|
86
|
+const currentYear = ref()
|
|
|
87
|
+currentYear.value = new Date().getFullYear()
|
|
|
88
|
+
|
|
|
89
|
+/* 获取用户部门信息 */
|
|
|
90
|
+const jsonArray = localStorage.getItem('dept')
|
|
|
91
|
+const deptInformation = ref([])
|
|
|
92
|
+try {
|
|
|
93
|
+ deptInformation.value = jsonArray ? JSON.parse(jsonArray) : [];
|
|
|
94
|
+} catch (error) {
|
|
|
95
|
+ deptInformation.value = [];
|
|
|
96
|
+}
|
|
|
97
|
+const deptName = deptInformation.value[0].deptName
|
|
|
98
|
+const deptCode = deptInformation.value[0].deptCode
|
|
|
99
|
+
|
|
|
100
|
+const guid = () => {
|
|
|
101
|
+ function S4() {
|
|
|
102
|
+ return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
|
|
|
103
|
+ }
|
|
|
104
|
+ return (S4()+S4()+S4()+S4()+S4()+S4()+S4()+S4())
|
|
|
105
|
+}
|
|
|
106
|
+const formJieguo = ref({
|
|
|
107
|
+ resultWhether:'',
|
|
|
108
|
+ resultDetail:'',
|
|
|
109
|
+ resultWhy:'',
|
|
|
110
|
+ resultFile:'',
|
|
|
111
|
+ itemsId:'',
|
|
|
112
|
+ resultFileId:'',
|
|
|
113
|
+ resType:''
|
|
|
114
|
+})
|
|
|
115
|
+const route = useRoute()
|
|
|
116
|
+let planInfo = {}
|
|
|
117
|
+const userName1=localStorage.getItem('userName');
|
|
|
118
|
+const isEdit = ref(route.query.mark === '1');
|
|
|
119
|
+
|
|
|
120
|
+const result1=ref('')
|
|
|
121
|
+const result2=ref('')
|
|
|
122
|
+const result3=ref('')
|
|
|
123
|
+const result4=ref('')
|
|
|
124
|
+const result5=ref('')
|
|
|
125
|
+const fromVue=ref({})
|
|
|
126
|
+if (route.query.mark) {
|
|
|
127
|
+ planInfo = JSON.parse(route.query.mark)
|
|
|
128
|
+}
|
|
|
129
|
+console.log(planInfo);
|
|
|
130
|
+if (planInfo==-1){
|
|
|
131
|
+ result1.value=guid()
|
|
|
132
|
+ result2.value=guid()
|
|
|
133
|
+ result3.value=guid()
|
|
|
134
|
+ result4.value=guid()
|
|
|
135
|
+ result5.value=guid()
|
|
|
136
|
+ generatedCode.value = generateCode();
|
|
|
137
|
+
|
|
|
138
|
+}
|
|
|
139
|
+
|
|
|
140
|
+const resDetail=ref('')
|
|
|
141
|
+const ruleIds = ref([]);
|
|
|
142
|
+/*const getRuleId = () => {
|
|
|
143
|
+ var url = '/sgsafe/ExamHead/getCheckRuleId'
|
|
|
144
|
+ var param = {}
|
|
|
145
|
+ proxy.$axios.get(url, param).then(response => {
|
|
|
146
|
+ if (response.data.code == '0') {
|
|
|
147
|
+ ruleIds.value = response.data.data
|
|
|
148
|
+ } else {
|
|
|
149
|
+ console.log("1111111");
|
|
|
150
|
+ }
|
|
|
151
|
+ })
|
|
|
152
|
+ console.log('ruleIds', ruleIds)
|
|
|
153
|
+}
|
|
|
154
|
+getRuleId()*/
|
|
|
155
|
+const showRule=ref(false);
|
|
|
156
|
+const showSmit=ref(true);
|
|
|
157
|
+const distestType=ref(false)
|
|
|
158
|
+if (planInfo==1) {
|
|
|
159
|
+ console.log(planInfo);
|
|
|
160
|
+ title = '修改管理档案'
|
|
|
161
|
+ fromVue.value= JSON.parse(route.query.data)
|
|
|
162
|
+ generatedCode.value = fromVue.value.caseNumber || '';
|
|
|
163
|
+ result1.value=fromVue.value.filePlan
|
|
|
164
|
+ result2.value=fromVue.value.filePic
|
|
|
165
|
+ result3.value=fromVue.value.fileEnd
|
|
|
166
|
+ result4.value=fromVue.value.fileOther
|
|
|
167
|
+ const userIds= localStorage.getItem('userId')
|
|
|
168
|
+ if (userIds != fromVue.value.addId) {
|
|
|
169
|
+ showSmit.value=false
|
|
|
170
|
+ title = '查看管理档案'
|
|
|
171
|
+ }
|
|
|
172
|
+
|
|
|
173
|
+}
|
|
|
174
|
+ const whether=ref(false)
|
|
|
175
|
+
|
|
|
176
|
+const planLevelList1=ref([])
|
|
|
177
|
+
|
|
|
178
|
+
|
|
|
179
|
+/* 下拉框 */
|
|
|
180
|
+const showActionSheet = ref(false)
|
|
|
181
|
+const showActionSheet1 = ref(false)
|
|
|
182
|
+const planLevelList = [
|
|
|
183
|
+ { name: '转发', value: '转发' },
|
|
|
184
|
+ { name: '内部', value: '内部' },
|
|
|
185
|
+ { name: '文章', value: '文章' }
|
|
|
186
|
+];
|
|
|
187
|
+const isdisabled=ref(true)
|
|
|
188
|
+const isdisabled2=ref(true)
|
|
|
189
|
+const onSelect = (item) => {
|
|
|
190
|
+fromVue.value.fileContent = item.name
|
|
|
191
|
+
|
|
|
192
|
+ showActionSheet.value=false
|
|
|
193
|
+}
|
|
|
194
|
+
|
|
|
195
|
+const onSelect2 = (item) => {
|
|
|
196
|
+ fromVue.value.fileType=item.name
|
|
|
197
|
+ showActionSheet2.value=false
|
|
|
198
|
+ }
|
|
|
199
|
+
|
|
|
200
|
+const onCaseSourseSelect = (item) => {
|
|
|
201
|
+ fromVue.value.caseSource=item.dicCode
|
|
|
202
|
+ caseSourceFlag.value = false
|
|
|
203
|
+}
|
|
|
204
|
+
|
|
|
205
|
+const onAccidentLevelSelect = (item) => {
|
|
|
206
|
+ fromVue.value.accidentLevel = item.dicCode
|
|
|
207
|
+ accidentLevelFlag.value = false
|
|
|
208
|
+
|
|
|
209
|
+}
|
|
|
210
|
+
|
|
|
211
|
+const displayFileName = ref('')
|
|
|
212
|
+const onSelect1 = (item) => {
|
|
|
213
|
+ console.log(item);
|
|
|
214
|
+ formJieguo.value.resultFile = item.value
|
|
|
215
|
+ result.value=formJieguo.value.resultFile
|
|
|
216
|
+ displayFileName.value = item.name
|
|
|
217
|
+
|
|
|
218
|
+ showActionSheet1.value = false
|
|
|
219
|
+}
|
|
|
220
|
+const questionIds = ref([])
|
|
|
221
|
+const actions=ref([])
|
|
|
222
|
+/*const getQuestionId = () => {
|
|
|
223
|
+ var url = '/sgsafe/AssessmentRecord/queryRuleNoPage';
|
|
|
224
|
+ var param = {};
|
|
|
225
|
+ proxy.$axios.get(url, param).then(response => {
|
|
|
226
|
+ if (response.data.code == '0') {
|
|
|
227
|
+ questionIds.value = response.data.data; // 先赋值给 questionIds.value
|
|
|
228
|
+
|
|
|
229
|
+
|
|
|
230
|
+ // ✅ 关键:使用 questionIds.value.map
|
|
|
231
|
+ actions.value = questionIds.value.map(item => ({
|
|
|
232
|
+ name: item.ruleName,
|
|
|
233
|
+ value: item.id
|
|
|
234
|
+ }));
|
|
|
235
|
+ console.log('actions:', actions.value); // 看看有没有输出
|
|
|
236
|
+ } else {
|
|
|
237
|
+ ElMessage.error('操作失败!' + response.data.msg);
|
|
|
238
|
+ }
|
|
|
239
|
+ });
|
|
|
240
|
+};
|
|
|
241
|
+getQuestionId()*/
|
|
|
242
|
+
|
|
|
243
|
+const baocun3 = (ruleFormRef) => {
|
|
|
244
|
+ console.log(formJieguo.value)
|
|
|
245
|
+ ruleFormRef.validate((valid, fields) => {
|
|
|
246
|
+ if (valid) {
|
|
|
247
|
+
|
|
|
248
|
+ var url = '/sgsafe/Manager/save';
|
|
|
249
|
+ var param = {
|
|
|
250
|
+ json: JSON.stringify(formJieguo.value)
|
|
|
251
|
+ };
|
|
|
252
|
+ proxy.$axios.post(url, param).then(response => {
|
|
|
253
|
+ if (response.data.code == '0') {
|
|
|
254
|
+ getTableData1()
|
|
|
255
|
+ ElMessage({
|
|
|
256
|
+ message: '保存成功',
|
|
|
257
|
+ type: 'success',
|
|
|
258
|
+ })
|
|
|
259
|
+ if (ruleFormRef.value) {
|
|
|
260
|
+ ruleFormRef.value.resetFields();
|
|
|
261
|
+ }
|
|
|
262
|
+ dialogVisibletemplate.value=false
|
|
|
263
|
+ } else {
|
|
|
264
|
+ ElMessage.error('操作失败!' + response.data.msg)
|
|
|
265
|
+ }
|
|
|
266
|
+
|
|
|
267
|
+ })
|
|
|
268
|
+ }
|
|
|
269
|
+ })
|
|
|
270
|
+}
|
|
|
271
|
+
|
|
|
272
|
+/* 组织树选择 */
|
|
|
273
|
+const showBottom = ref(false)
|
|
|
274
|
+import OrganizationalWithLeaf from '@/components/OrganizationalWithLeaf.vue';
|
|
|
275
|
+import { showFailToast, showLoadingToast, showSuccessToast } from 'vant';
|
|
|
276
|
+const handleTableDataUserDeptUpdate = async (nodeData) => {
|
|
|
277
|
+ console.log(nodeData);
|
|
|
278
|
+ const [deptCode, deptName] = nodeData.split('-', 2); // 只按第一个 '-' 分割
|
|
|
279
|
+ fromVue.value.activityDept = deptCode.trim();
|
|
|
280
|
+ fromVue.value.activityName = deptName.trim();
|
|
|
281
|
+
|
|
|
282
|
+ showBottom.value = false
|
|
|
283
|
+}
|
|
|
284
|
+
|
|
|
285
|
+/* 组织树选择 */
|
|
|
286
|
+const showBottom1 = ref(false)
|
|
|
287
|
+
|
|
|
288
|
+const handleTableDataUserDeptUpdate1 = async (nodeData) => {
|
|
|
289
|
+ console.log('选中的部门字符串:', nodeData); // e.g. "D1101120701-型钢炼钢站"
|
|
|
290
|
+
|
|
|
291
|
+ // 确保 nodeData 是字符串
|
|
|
292
|
+ if (typeof nodeData !== 'string') {
|
|
|
293
|
+ console.warn('nodeData 不是字符串,跳过处理');
|
|
|
294
|
+ showBottom1.value = false; // 假设你有另一个 showBottom1 控制弹窗
|
|
|
295
|
+ return;
|
|
|
296
|
+ }
|
|
|
297
|
+
|
|
|
298
|
+ // 获取当前已选的 otherDept,转为数组(按逗号分割)
|
|
|
299
|
+ const currentList = fromVue.value.otherDept
|
|
|
300
|
+ ? fromVue.value.otherDept.split(',').filter(item => item.trim() !== '')
|
|
|
301
|
+ : [];
|
|
|
302
|
+
|
|
|
303
|
+ // 可选:防止重复添加
|
|
|
304
|
+ if (!currentList.includes(nodeData)) {
|
|
|
305
|
+ currentList.push(nodeData);
|
|
|
306
|
+ }
|
|
|
307
|
+
|
|
|
308
|
+ // 重新拼成逗号分隔的字符串
|
|
|
309
|
+ fromVue.value.otherDept = currentList.join(',');
|
|
|
310
|
+
|
|
|
311
|
+ showBottom1.value = false;
|
|
|
312
|
+}
|
|
|
313
|
+
|
|
|
314
|
+const addEmergencyDrillPlan = async () => {
|
|
|
315
|
+ const loadingToast = showLoadingToast({
|
|
|
316
|
+ duration: 0,
|
|
|
317
|
+ message: '加载中',
|
|
|
318
|
+ forbidClick: true
|
|
|
319
|
+ })
|
|
|
320
|
+ var url = '/sgsafe/Manager/save';
|
|
|
321
|
+ const params = {
|
|
|
322
|
+ json: JSON.stringify(fromVue.value)
|
|
|
323
|
+ }
|
|
|
324
|
+ proxy.$axios.post(url,params).then(res=>{
|
|
|
325
|
+ if (res.data.code === 0) {
|
|
|
326
|
+ loadingToast.close()
|
|
|
327
|
+ showSuccessToast('保存成功')
|
|
|
328
|
+ onClickLeft()
|
|
|
329
|
+
|
|
|
330
|
+ } else {
|
|
|
331
|
+ loadingToast.close()
|
|
|
332
|
+ showFailToast('操作失败!' + res.data.msg)
|
|
|
333
|
+ }
|
|
|
334
|
+ })
|
|
|
335
|
+}
|
|
|
336
|
+const showDatePicker = ref(false)
|
|
|
337
|
+const onDatePicker = (value) => {
|
|
|
338
|
+ const dateArr = value.selectedValues
|
|
|
339
|
+ fromVue.value.startTime = dateArr[0] + '-' + dateArr[1] + '-' + dateArr[2]
|
|
|
340
|
+ showDatePicker.value = false
|
|
|
341
|
+}
|
|
|
342
|
+const currentDate = ref([2025, 7, 25])
|
|
|
343
|
+//定义字典集合
|
|
|
344
|
+const dicList = ref([])
|
|
|
345
|
+//获取字典集合
|
|
|
346
|
+// import tools from '@/tools'
|
|
|
347
|
+const getDicList = () => {
|
|
|
348
|
+ tools.dic.getDicList(['systemTypes']).then((response => {
|
|
|
349
|
+
|
|
|
350
|
+ const rawData = response.data.data
|
|
|
351
|
+ dicList.value = rawData.systemTypes.map(item => ({
|
|
|
352
|
+ name: item.dicName, // 必须有 name 字段!
|
|
|
353
|
+ code: item.dicCode // 可选,保留原始 code 供后续使用
|
|
|
354
|
+ }));
|
|
|
355
|
+ console.log(JSON.stringify(dicList.value))
|
|
|
356
|
+ }))
|
|
|
357
|
+}
|
|
|
358
|
+onMounted(() => {
|
|
|
359
|
+ getAccidentDicList()
|
|
|
360
|
+ console.log('这是编辑页面')
|
|
|
361
|
+ const today = new Date()
|
|
|
362
|
+ const year = today.getFullYear()
|
|
|
363
|
+ const month = today.getMonth() + 1 // 月份从 0 开始
|
|
|
364
|
+ const day = today.getDate()
|
|
|
365
|
+ currentDate.value = [year, month, day]
|
|
|
366
|
+ currentDate1.value = [year, month, day]
|
|
|
367
|
+
|
|
|
368
|
+ //selectedDateText.value = `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`
|
|
|
369
|
+ getDicList()
|
|
|
370
|
+})
|
|
|
371
|
+const showActionSheet2=ref(false)
|
|
|
372
|
+/* 文件上传 */
|
|
|
373
|
+import AttachmentS3 from '@/components/AttachmentS3.vue';
|
|
|
374
|
+import OrganizationalWithLeafUser from '@/components/OrganizationalWithLeafUser.vue';
|
|
|
375
|
+
|
|
|
376
|
+const onSubmit = (values) => {
|
|
|
377
|
+ fromVue.value.caseNumber = generatedCode.value;
|
|
|
378
|
+
|
|
|
379
|
+ fromVue.value.filePlan =result1.value
|
|
|
380
|
+ fromVue.value.filePic=result2.value
|
|
|
381
|
+ fromVue.value.fileEnd =result3.value
|
|
|
382
|
+ fromVue.value.fileOther=result4.value
|
|
|
383
|
+ fromVue.value.filePicBefore=fileUrl.value
|
|
|
384
|
+ addEmergencyDrillPlan()
|
|
|
385
|
+}
|
|
|
386
|
+const leaderKeyysr = guid();
|
|
|
387
|
+const PopupDepartmentLeaderNameRefysr = ref();
|
|
|
388
|
+const handleDepartmentLeaderNameysr = () => {
|
|
|
389
|
+ PopupDepartmentLeaderNameRefysr.value.open();
|
|
|
390
|
+};
|
|
|
391
|
+const getDepartmentLeaderNameysr = (item) => {
|
|
|
392
|
+ fromVue.value.punCode = item.user.userCode;
|
|
|
393
|
+ fromVue.value.punName = item.user.userDesc;
|
|
|
394
|
+ fromVue.value.punId = item.user.id
|
|
|
395
|
+};
|
|
|
396
|
+
|
|
|
397
|
+const onCaseSourceConfirm = ({ selectedOptions }) => {
|
|
|
398
|
+ caseSourceFlag.value = false;
|
|
|
399
|
+ fromVue.value.caseType = selectedOptions[0].text;
|
|
|
400
|
+};
|
|
|
401
|
+
|
|
|
402
|
+const onAccidentLevelConfirm = ({ selectedOptions }) => {
|
|
|
403
|
+ accidentLevelFlag.value = false;
|
|
|
404
|
+ fromVue.value.caseType = selectedOptions[0].text;
|
|
|
405
|
+};
|
|
|
406
|
+
|
|
|
407
|
+const onprimaryTwoConfirm = ({ selectedOptions }) => {
|
|
|
408
|
+ primaryDomainTwoFlag.value = false;
|
|
|
409
|
+ fromVue.value.primaryDomainTwo = selectedOptions[0].text;
|
|
|
410
|
+};
|
|
|
411
|
+const selectedPrimary = ref(null)
|
|
|
412
|
+const onprimaryConfirm = ({ selectedOptions }) => {
|
|
|
413
|
+ if (!selectedOptions?.length) {
|
|
|
414
|
+ selectedPrimary.value = null;
|
|
|
415
|
+ fromVue.value.primaryDomainTwo = '';
|
|
|
416
|
+ primaryDomainFlag.value = false;
|
|
|
417
|
+ return;
|
|
|
418
|
+ }
|
|
|
419
|
+
|
|
|
420
|
+ primaryDomainFlag.value = false;
|
|
|
421
|
+ fromVue.value.primaryDomain = selectedOptions[0].text;
|
|
|
422
|
+
|
|
|
423
|
+ const primaryList = accidentDictList.value?.primary_domain || [];
|
|
|
424
|
+ const selectedItem = primaryList.find(item => item.dicName === selectedOptions[0].text);
|
|
|
425
|
+
|
|
|
426
|
+ selectedPrimary.value = selectedItem || null;
|
|
|
427
|
+ fromVue.value.primaryDomainTwo = '';
|
|
|
428
|
+};
|
|
|
429
|
+
|
|
|
430
|
+const filteredSecondaryList = computed(() =>
|
|
|
431
|
+ selectedPrimary.value?.dicValue1
|
|
|
432
|
+ ? (accidentDictList.value?.primary_domain_two || [])
|
|
|
433
|
+ .filter(item => item.dicValue1 === selectedPrimary.value.dicValue1)
|
|
|
434
|
+ .map(({ dicName, dicCode }) => ({ text: dicName, value: dicCode }))
|
|
|
435
|
+ : []
|
|
|
436
|
+);
|
|
|
437
|
+const getDepartmentJoinPerson = (userArray) => {
|
|
|
438
|
+
|
|
|
439
|
+}
|
|
|
440
|
+const currentDate1 = ref([2025, 7, 25])
|
|
|
441
|
+const showDatePicker1 = ref(false)
|
|
|
442
|
+const onDatePicker1 = (value) => {
|
|
|
443
|
+ const dateArr = value.selectedValues
|
|
|
444
|
+ fromVue.value.endTime = dateArr[0] + '-' + dateArr[1] + '-' + dateArr[2]
|
|
|
445
|
+ showDatePicker1.value = false
|
|
|
446
|
+}
|
|
|
447
|
+const fileUrl=ref('')
|
|
|
448
|
+const handleFirstFileUrl = (url) => {
|
|
|
449
|
+ console.log('第一张文件URL:', url)
|
|
|
450
|
+ fileUrl.value=url
|
|
|
451
|
+}
|
|
|
452
|
+import AttachmentS3ImageReturnURL from '@/components/AttachmentS3ImageReturnURL.vue';
|
|
|
453
|
+</script>
|
|
|
454
|
+
|
|
|
455
|
+<template>
|
|
|
456
|
+
|
|
|
457
|
+ <div class="page-container">
|
|
|
458
|
+ <van-sticky class="header">
|
|
|
459
|
+ <van-nav-bar
|
|
|
460
|
+ :title="title"
|
|
|
461
|
+ left-text="返回"
|
|
|
462
|
+ left-arrow
|
|
|
463
|
+ @click-left="onClickLeft" >
|
|
|
464
|
+ </van-nav-bar>
|
|
|
465
|
+ </van-sticky>
|
|
|
466
|
+ <div class="scroll-container">
|
|
|
467
|
+ <van-form @submit="onSubmit">
|
|
|
468
|
+<!-- <van-field-->
|
|
|
469
|
+<!-- v-model="fromVue.caseNumber"-->
|
|
|
470
|
+<!-- label="案例编号"-->
|
|
|
471
|
+<!-- name="caseNumber"-->
|
|
|
472
|
+<!-- required-->
|
|
|
473
|
+<!-- placeholder="请输入案例编号"-->
|
|
|
474
|
+<!-- :rules="[{required: true, message: '请输入文件编号'}]"-->
|
|
|
475
|
+<!-- />-->
|
|
|
476
|
+ <van-field
|
|
|
477
|
+ v-model="generatedCode"
|
|
|
478
|
+ label="案例编号"
|
|
|
479
|
+ name="caseNumber"
|
|
|
480
|
+ :readonly="true"
|
|
|
481
|
+ :rules="[{required: true, message: '编号生成失败,请点击“重新生成”'}]"
|
|
|
482
|
+ />
|
|
|
483
|
+
|
|
|
484
|
+ <van-field
|
|
|
485
|
+ v-model="fromVue.activityTitle"
|
|
|
486
|
+ label="活动主题"
|
|
|
487
|
+ name="caseTitle"
|
|
|
488
|
+ required
|
|
|
489
|
+ placeholder="请输入活动主题"
|
|
|
490
|
+ :rules="[{required: true, message: '请输入活动主题'}]"
|
|
|
491
|
+ />
|
|
|
492
|
+
|
|
|
493
|
+ <van-field
|
|
|
494
|
+ v-model="fromVue.caseType"
|
|
|
495
|
+ readonly
|
|
|
496
|
+ label="案例类型"
|
|
|
497
|
+ name="caseType"
|
|
|
498
|
+ required
|
|
|
499
|
+ @click="caseSourceFlag = true"
|
|
|
500
|
+ />
|
|
|
501
|
+ <van-field
|
|
|
502
|
+ readonly
|
|
|
503
|
+ v-model="fromVue.activityType"
|
|
|
504
|
+ label="活动形式"
|
|
|
505
|
+ name="activityType"
|
|
|
506
|
+ @click="accidentLevelFlag = true"
|
|
|
507
|
+ />
|
|
|
508
|
+
|
|
|
509
|
+ <van-field
|
|
|
510
|
+ v-model="fromVue.startTime"
|
|
|
511
|
+ readonly
|
|
|
512
|
+ label="开始时间"
|
|
|
513
|
+ name="startTime"
|
|
|
514
|
+ required
|
|
|
515
|
+ placeholder="请选择开始时间"
|
|
|
516
|
+ :rules="[{required: true, message: '请输入开始时间'}]"
|
|
|
517
|
+ @click="showDatePicker = true"
|
|
|
518
|
+ />
|
|
|
519
|
+ <van-field
|
|
|
520
|
+ v-model="fromVue.endTime"
|
|
|
521
|
+ readonly
|
|
|
522
|
+ label="结束时间"
|
|
|
523
|
+ name="endTime"
|
|
|
524
|
+ required
|
|
|
525
|
+ placeholder="请选择结束时间"
|
|
|
526
|
+ :rules="[{required: true, message: '请输入结束时间'}]"
|
|
|
527
|
+ @click="showDatePicker1 = true"
|
|
|
528
|
+ />
|
|
|
529
|
+ <van-field
|
|
|
530
|
+ readonly
|
|
|
531
|
+ v-model="fromVue.activityName"
|
|
|
532
|
+ label="主办单位"
|
|
|
533
|
+ name="perName"
|
|
|
534
|
+ @click="showBottom=true"
|
|
|
535
|
+ />
|
|
|
536
|
+ <van-field
|
|
|
537
|
+ readonly
|
|
|
538
|
+ v-model="fromVue.otherDept"
|
|
|
539
|
+ label="协办/承办单位"
|
|
|
540
|
+ name="perName"
|
|
|
541
|
+ @click="showBottom1=true"
|
|
|
542
|
+ />
|
|
|
543
|
+
|
|
|
544
|
+ <van-field
|
|
|
545
|
+ v-model="fromVue.activitySummary"
|
|
|
546
|
+ label="活动简介"
|
|
|
547
|
+ name="activitySummary"
|
|
|
548
|
+ required
|
|
|
549
|
+ rows="3"
|
|
|
550
|
+ autosize
|
|
|
551
|
+ type="textarea"
|
|
|
552
|
+ placeholder="请输入活动简介"
|
|
|
553
|
+ :rules="[{required: true, message: '请输入活动简介'}]"
|
|
|
554
|
+ />
|
|
|
555
|
+
|
|
|
556
|
+ <van-field label="活动照片">
|
|
|
557
|
+ <template #input>
|
|
|
558
|
+ <AttachmentS3ImageReturnURL style="background-color: white;" :f-id="result2" @update:firstFileUrl="handleFirstFileUrl" />
|
|
|
559
|
+ </template>
|
|
|
560
|
+ </van-field>
|
|
|
561
|
+
|
|
|
562
|
+ <van-field label="活动方案" >
|
|
|
563
|
+ <template #input>
|
|
|
564
|
+ <AttachmentS3 :f-id="result1" />
|
|
|
565
|
+ </template>
|
|
|
566
|
+ </van-field>
|
|
|
567
|
+ <van-field label="活动总结及效果评价" >
|
|
|
568
|
+ <template #input>
|
|
|
569
|
+ <AttachmentS3 :f-id="result3" />
|
|
|
570
|
+ </template>
|
|
|
571
|
+ </van-field>
|
|
|
572
|
+ <van-field label="签到表及其他材料" >
|
|
|
573
|
+ <template #input>
|
|
|
574
|
+ <AttachmentS3 :f-id="result4" />
|
|
|
575
|
+ </template>
|
|
|
576
|
+ </van-field>
|
|
|
577
|
+ <div style="margin: 16px;">
|
|
|
578
|
+ <van-button round block type="primary" v-show='showSmit' native-type="submit">
|
|
|
579
|
+ {{ isEdit ? '保存' : '提交' }}
|
|
|
580
|
+ </van-button>
|
|
|
581
|
+ </div>
|
|
|
582
|
+ </van-form>
|
|
|
583
|
+
|
|
|
584
|
+ <van-action-sheet
|
|
|
585
|
+ v-model:show="showActionSheet"
|
|
|
586
|
+ :actions="planLevelList"
|
|
|
587
|
+ @select="onSelect"
|
|
|
588
|
+ />
|
|
|
589
|
+ <van-action-sheet
|
|
|
590
|
+ v-model:show="showActionSheet2"
|
|
|
591
|
+ :actions="dicList"
|
|
|
592
|
+ @select="onSelect2"
|
|
|
593
|
+ />
|
|
|
594
|
+
|
|
|
595
|
+ <van-popup v-model:show="caseSourceFlag" round position="bottom">
|
|
|
596
|
+ <van-picker
|
|
|
597
|
+ :columns="columns"
|
|
|
598
|
+ @cancel="caseSourceFlag = false"
|
|
|
599
|
+ @confirm="onCaseSourceConfirm"
|
|
|
600
|
+ />
|
|
|
601
|
+ </van-popup>
|
|
|
602
|
+
|
|
|
603
|
+ <van-popup v-model:show="accidentLevelFlag" round position="bottom">
|
|
|
604
|
+ <van-picker
|
|
|
605
|
+ :columns="columnsLevel"
|
|
|
606
|
+ @cancel="accidentLevelFlag = false"
|
|
|
607
|
+ @confirm="onAccidentLevelConfirm"
|
|
|
608
|
+ />
|
|
|
609
|
+ </van-popup>
|
|
|
610
|
+ <van-popup v-model:show="primaryDomainFlag" round position="bottom">
|
|
|
611
|
+ <van-picker
|
|
|
612
|
+ :columns="columnsprimary"
|
|
|
613
|
+ @cancel="primaryDomainFlag = false"
|
|
|
614
|
+ @confirm="onprimaryConfirm"
|
|
|
615
|
+ />
|
|
|
616
|
+ </van-popup>
|
|
|
617
|
+ <van-popup v-model:show="primaryDomainTwoFlag" round position="bottom">
|
|
|
618
|
+ <van-picker
|
|
|
619
|
+ :columns="filteredSecondaryList"
|
|
|
620
|
+ @cancel="primaryDomainTwoFlag = false"
|
|
|
621
|
+ @confirm="onprimaryTwoConfirm"
|
|
|
622
|
+ />
|
|
|
623
|
+ </van-popup>
|
|
|
624
|
+
|
|
|
625
|
+<!-- <van-action-sheet-->
|
|
|
626
|
+<!-- v-model:show="accidentLevelFlag"-->
|
|
|
627
|
+<!-- :actions="accidentDictList.accident_level"-->
|
|
|
628
|
+<!-- @select="onAccidentLevelSelect"-->
|
|
|
629
|
+<!-- />-->
|
|
|
630
|
+
|
|
|
631
|
+<!-- <van-action-sheet-->
|
|
|
632
|
+<!-- v-model:show="showActionSheet1"-->
|
|
|
633
|
+<!-- :actions="planLevelList1"-->
|
|
|
634
|
+<!-- field-names="{ text: 'fileName', value: 'fileId' }"-->
|
|
|
635
|
+<!-- @select="onSelect1"-->
|
|
|
636
|
+<!-- />-->
|
|
|
637
|
+
|
|
|
638
|
+ <van-popup v-model:show="showBottom" position="bottom" :style="{ height: '30%' }">
|
|
|
639
|
+ <OrganizationalWithLeaf @update:selected-node="handleTableDataUserDeptUpdate" />
|
|
|
640
|
+ </van-popup>
|
|
|
641
|
+ <van-popup v-model:show="showBottom1" position="bottom" :style="{ height: '30%' }">
|
|
|
642
|
+ <OrganizationalWithLeaf @update:selected-node="handleTableDataUserDeptUpdate1" />
|
|
|
643
|
+ </van-popup>
|
|
|
644
|
+ <van-popup v-model:show="showDatePicker" position="bottom">
|
|
|
645
|
+ <van-date-picker
|
|
|
646
|
+ v-model="currentDate"
|
|
|
647
|
+ @confirm="onDatePicker"
|
|
|
648
|
+ @cancel="showDatePicker = false" />
|
|
|
649
|
+ </van-popup>
|
|
|
650
|
+ <van-popup v-model:show="showDatePicker1" position="bottom">
|
|
|
651
|
+ <van-date-picker
|
|
|
652
|
+ v-model="currentDate1"
|
|
|
653
|
+ @confirm="onDatePicker1"
|
|
|
654
|
+ @cancel="showDatePicker1 = false" />
|
|
|
655
|
+ </van-popup>
|
|
|
656
|
+
|
|
|
657
|
+ </div>
|
|
|
658
|
+ </div>
|
|
|
659
|
+</template>
|
|
|
660
|
+
|
|
|
661
|
+<style scoped>
|
|
|
662
|
+.page-container {
|
|
|
663
|
+ height: 100vh; /* 关键:外层容器高度设为视口高度 */
|
|
|
664
|
+ display: flex;
|
|
|
665
|
+ flex-direction: column;
|
|
|
666
|
+
|
|
|
667
|
+}
|
|
|
668
|
+/* overflow-y: auto; !* 启用垂直滚动 *!*/
|
|
|
669
|
+
|
|
|
670
|
+
|
|
|
671
|
+.scroll-container {
|
|
|
672
|
+ flex: 1;
|
|
|
673
|
+ overflow: auto;
|
|
|
674
|
+ -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
|
|
|
675
|
+}
|
|
|
676
|
+
|
|
|
677
|
+/* 可选:隐藏滚动条(视觉优化) */
|
|
|
678
|
+.scroll-container::-webkit-scrollbar {
|
|
|
679
|
+ display: none;
|
|
|
680
|
+}
|
|
|
681
|
+
|
|
|
682
|
+.header, .footer {
|
|
|
683
|
+ /* 固定高度区域 */
|
|
|
684
|
+ flex-shrink: 0; /* 防止被压缩 */
|
|
|
685
|
+ background: #f5f5f5;
|
|
|
686
|
+ padding: 12px;
|
|
|
687
|
+}
|
|
|
688
|
+.row-container {
|
|
|
689
|
+ display: flex;
|
|
|
690
|
+ justify-content: space-between; /* 关键:左右分布 */
|
|
|
691
|
+ align-items: center; /* 垂直居中 */
|
|
|
692
|
+
|
|
|
693
|
+}
|
|
|
694
|
+
|
|
|
695
|
+.cell-period-text {
|
|
|
696
|
+ font-size: 14px;
|
|
|
697
|
+ color: #333;
|
|
|
698
|
+ white-space: nowrap;
|
|
|
699
|
+ overflow: hidden;
|
|
|
700
|
+ text-overflow: ellipsis;
|
|
|
701
|
+
|
|
|
702
|
+}
|
|
|
703
|
+
|
|
|
704
|
+.mini-btn {
|
|
|
705
|
+ height: 22px;
|
|
|
706
|
+ font-size: 12px;
|
|
|
707
|
+ padding: 0 8px;
|
|
|
708
|
+ min-width: 60px; /* 可选:保持按钮最小宽度一致 */
|
|
|
709
|
+}
|
|
|
710
|
+</style>
|