|
|
@@ -5,75 +5,76 @@
|
|
5
|
5
|
<uni-forms ref="form" :rules="rules" :modelValue="formData" label-position="top" err-show-type="modal">
|
|
6
|
6
|
<!-- <scroll-view class="form-scroll" scroll-y> -->
|
|
7
|
7
|
<!-- 安检员信息分组 (默认折叠) -->
|
|
8
|
|
- <view class="card">
|
|
9
|
|
- <uni-collapse class="collapse" :accordion="false" :value="['group1']">
|
|
10
|
|
- <uni-collapse-item class="collapse-item" title="安检员信息" name="group1" :show-animation="true">
|
|
11
|
|
- <template v-slot:title>
|
|
12
|
|
- <view class="header-section collapse-title userInfo">
|
|
13
|
|
- <view class="userName">{{ `${type !== 'add' ? '查获人:' : ''}` }}{{ type !==
|
|
14
|
|
- 'add' ? `${formData.inspectUserName}(${formData.createBy})` :
|
|
15
|
|
- `${userInfo.nickName}(${userInfo.userName})`
|
|
16
|
|
- }}
|
|
17
|
|
- </view>
|
|
18
|
|
- <view class="teamInfo" v-if="type !== 'add'">
|
|
19
|
|
- <view>{{ formData.inspectUserRoleName }}</view>
|
|
20
|
|
- <view class="team">
|
|
21
|
|
-
|
|
22
|
|
- <view v-if="formData.inspectStationName">
|
|
23
|
|
- {{ formData.inspectStationName }}
|
|
24
|
|
- </view>
|
|
25
|
|
- <view v-if="formData.inspectDepartmentName">
|
|
26
|
|
- /{{ formData.inspectDepartmentName }}
|
|
27
|
|
- </view>
|
|
28
|
|
- <view v-if="formData.inspectTeamName">
|
|
29
|
|
- /{{ formData.inspectTeamName }}
|
|
30
|
|
- </view>
|
|
|
8
|
+ <!-- <view class="card" style="overflow: visible;"> -->
|
|
|
9
|
+ <uni-collapse class="collapse" :class="firstCollapsed.length > 0 ? 'collapse-card' : 'collapse-card-hidden'"
|
|
|
10
|
+ :accordion="false" v-model="firstCollapsed" @change="changeCollapse">
|
|
|
11
|
+ <uni-collapse-item class="collapse-item" title="安检员信息" name="group1" :show-animation="true">
|
|
|
12
|
+ <template v-slot:title>
|
|
|
13
|
+ <view class="header-section collapse-title userInfo">
|
|
|
14
|
+ <view class="userName">{{ `${type !== 'add' ? '查获人:' : ''}` }}{{ type !==
|
|
|
15
|
+ 'add' ? `${formData.inspectUserName}(${formData.createBy})` :
|
|
|
16
|
+ `${userInfo.nickName}(${userInfo.userName})`
|
|
|
17
|
+ }}
|
|
|
18
|
+ </view>
|
|
|
19
|
+ <view class="teamInfo" v-if="type !== 'add'">
|
|
|
20
|
+ <view>{{ formData.inspectUserRoleName }}</view>
|
|
|
21
|
+ <view class="team">
|
|
|
22
|
+
|
|
|
23
|
+ <view v-if="formData.inspectStationName">
|
|
|
24
|
+ {{ formData.inspectStationName }}
|
|
31
|
25
|
</view>
|
|
32
|
|
- </view>
|
|
33
|
|
- <view class="teamInfo" v-else>
|
|
34
|
|
- <view>安检员</view>
|
|
35
|
|
- <view class="team">
|
|
36
|
|
-
|
|
37
|
|
- <view v-if="userInfo.stationName">
|
|
38
|
|
- {{ userInfo.stationName }}
|
|
39
|
|
- </view>
|
|
40
|
|
- <view v-if="userInfo.departmentName">
|
|
41
|
|
- /{{ userInfo.departmentName }}
|
|
42
|
|
- </view>
|
|
43
|
|
- <view v-if="userInfo.teamsName">
|
|
44
|
|
- /{{ userInfo.teamsName }}
|
|
45
|
|
- </view>
|
|
|
26
|
+ <view v-if="formData.inspectDepartmentName">
|
|
|
27
|
+ /{{ formData.inspectDepartmentName }}
|
|
|
28
|
+ </view>
|
|
|
29
|
+ <view v-if="formData.inspectTeamName">
|
|
|
30
|
+ /{{ formData.inspectTeamName }}
|
|
46
|
31
|
</view>
|
|
47
|
32
|
</view>
|
|
48
|
|
-
|
|
49
|
33
|
</view>
|
|
50
|
|
- </template>
|
|
|
34
|
+ <view class="teamInfo" v-else>
|
|
|
35
|
+ <view>安检员</view>
|
|
|
36
|
+ <view class="team">
|
|
51
|
37
|
|
|
52
|
|
- <uni-forms-item label="查获时间" name="seizureTime" required>
|
|
53
|
|
- <uni-datetime-picker :disabled="isDetailMode" type="datetime" :start="startDate" :end="endDate"
|
|
54
|
|
- v-model="formData.seizureTime" />
|
|
55
|
|
- </uni-forms-item>
|
|
56
|
|
-
|
|
57
|
|
- <uni-forms-item label="安检岗位" name="checkMethodText" required>
|
|
58
|
|
- <uni-combox :disabled="isDetailMode" :candidates="checkMethodCandidates" placeholder="请选择安检岗位"
|
|
59
|
|
- v-model="formData.checkMethodText" @input="onCheckMethodComboxChange" />
|
|
60
|
|
- </uni-forms-item>
|
|
61
|
|
-
|
|
62
|
|
- <uni-forms-item label="查获位置" name="securityLocation" required>
|
|
63
|
|
- <uni-data-picker v-if="!isDetailMode" :readonly="isDetailMode" :localdata="position_options"
|
|
64
|
|
- popup-title="请选择查获位置" v-model="formData.securityLocation" @change="onLocationChange" />
|
|
65
|
|
- <uni-easyinput v-else :disabled="true" placeholder="请选择查获班组" :value="formData.securityLocationText" />
|
|
66
|
|
- </uni-forms-item>
|
|
67
|
|
-
|
|
68
|
|
- <uni-forms-item label="查获班组" name="reportTeam" required>
|
|
69
|
|
- <uni-data-picker v-if="!isDetailMode" :readonly="isDetailMode" :localdata="teams" popup-title="请选择查获班组"
|
|
70
|
|
- v-model="formData.reportTeam" @change="onReportTeamChange" />
|
|
|
38
|
+ <view v-if="userInfo.stationName">
|
|
|
39
|
+ {{ userInfo.stationName }}
|
|
|
40
|
+ </view>
|
|
|
41
|
+ <view v-if="userInfo.departmentName">
|
|
|
42
|
+ /{{ userInfo.departmentName }}
|
|
|
43
|
+ </view>
|
|
|
44
|
+ <view v-if="userInfo.teamsName">
|
|
|
45
|
+ /{{ userInfo.teamsName }}
|
|
|
46
|
+ </view>
|
|
|
47
|
+ </view>
|
|
|
48
|
+ </view>
|
|
71
|
49
|
|
|
72
|
|
- <uni-easyinput v-else :disabled="true" placeholder="请选择查获班组" :value="formData.attendanceTeamName" />
|
|
73
|
|
- </uni-forms-item>
|
|
74
|
|
- </uni-collapse-item>
|
|
75
|
|
- </uni-collapse>
|
|
76
|
|
- </view>
|
|
|
50
|
+ </view>
|
|
|
51
|
+ </template>
|
|
|
52
|
+
|
|
|
53
|
+ <uni-forms-item label="查获时间" name="seizureTime" required>
|
|
|
54
|
+ <uni-datetime-picker :disabled="isDetailMode" type="datetime" :start="startDate" :end="endDate"
|
|
|
55
|
+ v-model="formData.seizureTime" />
|
|
|
56
|
+ </uni-forms-item>
|
|
|
57
|
+
|
|
|
58
|
+ <uni-forms-item label="安检岗位" name="checkMethodText" required>
|
|
|
59
|
+ <uni-combox :disabled="isDetailMode" :candidates="checkMethodCandidates" placeholder="请选择安检岗位"
|
|
|
60
|
+ v-model="formData.checkMethodText" @input="onCheckMethodComboxChange" />
|
|
|
61
|
+ </uni-forms-item>
|
|
|
62
|
+
|
|
|
63
|
+ <uni-forms-item label="查获位置" name="securityLocation" required>
|
|
|
64
|
+ <uni-data-picker v-if="!isDetailMode" :readonly="isDetailMode" :localdata="position_options"
|
|
|
65
|
+ popup-title="请选择查获位置" v-model="formData.securityLocation" @change="onLocationChange" />
|
|
|
66
|
+ <uni-easyinput v-else :disabled="true" placeholder="请选择查获班组" :value="formData.securityLocationText" />
|
|
|
67
|
+ </uni-forms-item>
|
|
|
68
|
+
|
|
|
69
|
+ <uni-forms-item label="查获班组" name="reportTeam" required>
|
|
|
70
|
+ <uni-data-picker v-if="!isDetailMode" :readonly="isDetailMode" :localdata="teams" popup-title="请选择查获班组"
|
|
|
71
|
+ v-model="formData.reportTeam" @change="onReportTeamChange" />
|
|
|
72
|
+
|
|
|
73
|
+ <uni-easyinput v-else :disabled="true" placeholder="请选择查获班组" :value="formData.attendanceTeamName" />
|
|
|
74
|
+ </uni-forms-item>
|
|
|
75
|
+ </uni-collapse-item>
|
|
|
76
|
+ </uni-collapse>
|
|
|
77
|
+ <!-- </view> -->
|
|
77
|
78
|
|
|
78
|
79
|
<!-- 违禁品信息分组 -->
|
|
79
|
80
|
<view class="card">
|
|
|
@@ -164,7 +165,7 @@
|
|
164
|
165
|
<view class="card" v-if="!isDetailMode || isDetailMode && formData.images.length > 0">
|
|
165
|
166
|
<uni-collapse class="collapse" :accordion="false" :value="['group4']">
|
|
166
|
167
|
<uni-collapse-item class="collapse-item" title="违禁品照片 (可选)" name="group4" :show-animation="true">
|
|
167
|
|
- <view style="padding: 0 15px 15px 15px;">
|
|
|
168
|
+ <view style="padding: 0 15px 15px 15px;margin-bottom: 150rpx;">
|
|
168
|
169
|
<uni-file-picker :disabled="isDetailMode" v-model="formData.images" limit="8" title="最多上传8张"
|
|
169
|
170
|
:image-styles="imageStyles" fileMediatype="image" mode="grid" @select="onSelect" />
|
|
170
|
171
|
</view>
|
|
|
@@ -429,7 +430,8 @@ export default {
|
|
429
|
430
|
nodeCode: '',
|
|
430
|
431
|
id: '',
|
|
431
|
432
|
type: '',
|
|
432
|
|
- approvalHistory: []
|
|
|
433
|
+ approvalHistory: [],
|
|
|
434
|
+ firstCollapsed: ["group1"],
|
|
433
|
435
|
}
|
|
434
|
436
|
},
|
|
435
|
437
|
async onLoad(options) {
|
|
|
@@ -446,7 +448,7 @@ export default {
|
|
446
|
448
|
this.type = params?.type || 'add';
|
|
447
|
449
|
// }
|
|
448
|
450
|
await this.initPageData();
|
|
449
|
|
- if (this.type == 'add') {
|
|
|
451
|
+ if (this.type == 'add') {
|
|
450
|
452
|
this.invokerGetLocationsbyTime()
|
|
451
|
453
|
}
|
|
452
|
454
|
|
|
|
@@ -468,6 +470,9 @@ export default {
|
|
468
|
470
|
// this.formData.comment = rejectReason
|
|
469
|
471
|
// this.handleApproveReject()
|
|
470
|
472
|
// },
|
|
|
473
|
+ changeCollapse(e) {
|
|
|
474
|
+ this.firstCollapsed = e
|
|
|
475
|
+ },
|
|
471
|
476
|
//审批通过
|
|
472
|
477
|
async handleApprovePass() {
|
|
473
|
478
|
try {
|
|
|
@@ -549,7 +554,10 @@ export default {
|
|
549
|
554
|
// 填充表单数据
|
|
550
|
555
|
fillFormData(detailData) {
|
|
551
|
556
|
if (!detailData) return;
|
|
552
|
|
-
|
|
|
557
|
+ let files = detailData?.itemSeizureItemsList[0].baseAttachmentList.map(file => ({
|
|
|
558
|
+ ...file,
|
|
|
559
|
+ url: file.attachmentUrl || file.url,
|
|
|
560
|
+ }))
|
|
553
|
561
|
// 填充基础信息
|
|
554
|
562
|
this.formData = {
|
|
555
|
563
|
...this.formData,
|
|
|
@@ -572,13 +580,13 @@ export default {
|
|
572
|
580
|
partType: detailData?.itemSeizureItemsList[0].checkPositionCodeTwo,
|
|
573
|
581
|
partTypeText: detailData?.itemSeizureItemsList[0].checkPositionNameTwo,
|
|
574
|
582
|
forbiddenName: detailData?.itemSeizureItemsList[0].itemName,
|
|
575
|
|
- images: detailData?.itemSeizureItemsList[0].baseAttachmentList || [],
|
|
|
583
|
+ images: files || [],
|
|
576
|
584
|
location: detailData?.itemSeizureItemsList[0].location,
|
|
577
|
585
|
isActiveConcealment: String(detailData?.itemSeizureItemsList[0].isActiveConcealment),
|
|
578
|
586
|
handlingMethodDesc: detailData?.itemSeizureItemsList[0].handlingMethodDesc,
|
|
579
|
587
|
handlingMethod: detailData?.itemSeizureItemsList[0].handlingMethod,
|
|
580
|
588
|
// reportTeamText:`${detailData?.inspectStationName}/${detailData?.inspectBrigadeName}/${detailData?.inspectDepartmentName}/${detailData?.inspectTeamName}`,
|
|
581
|
|
- securityLocationText:`${detailData?.terminlName}/${detailData?.regionalName}/${detailData?.channelName}`
|
|
|
589
|
+ securityLocationText: `${detailData?.terminlName}/${detailData?.regionalName}/${detailData?.channelName}`
|
|
582
|
590
|
};
|
|
583
|
591
|
|
|
584
|
592
|
this.$nextTick(() => {
|
|
|
@@ -614,7 +622,7 @@ export default {
|
|
614
|
622
|
},
|
|
615
|
623
|
|
|
616
|
624
|
searchLoadData(val) {
|
|
617
|
|
- return categoryList(val).then(res => {
|
|
|
625
|
+ return categoryList({ name: val, level: 2 }).then(res => {
|
|
618
|
626
|
return res.data
|
|
619
|
627
|
})
|
|
620
|
628
|
},
|
|
|
@@ -803,35 +811,41 @@ export default {
|
|
803
|
811
|
|
|
804
|
812
|
// 选择文件后手动上传
|
|
805
|
813
|
async onSelect(event) {
|
|
|
814
|
+ // 由于限制只能上传1个文件,直接取第一个文件进行上传
|
|
|
815
|
+ const files = await this.uploadFile(event);
|
|
806
|
816
|
|
|
807
|
|
- const file = await this.uploadFile(event)
|
|
808
|
|
- console.log("file", file)
|
|
809
|
|
- console.log("上传成功====");
|
|
810
|
|
- this.formData.images.push({
|
|
|
817
|
+ console.log("上传成功====", files);
|
|
|
818
|
+ let fileArr = files.map(file => ({
|
|
811
|
819
|
url: file.url,
|
|
812
|
820
|
name: file.newFileName,
|
|
813
|
821
|
attachmentName: file.newFileName,
|
|
814
|
822
|
attachmentUrl: file.url,
|
|
815
|
823
|
extname: file.newFileName.split('.').pop()
|
|
816
|
|
- });
|
|
|
824
|
+ }))
|
|
|
825
|
+ // 直接替换而不是追加,因为限制只能上传1张
|
|
|
826
|
+ this.formData.images = [
|
|
|
827
|
+ ...this.formData.images,
|
|
|
828
|
+ ...fileArr
|
|
|
829
|
+ ];
|
|
817
|
830
|
},
|
|
818
|
831
|
|
|
819
|
832
|
// 封装上传
|
|
820
|
833
|
uploadFile(event) {
|
|
821
|
|
- return new Promise((resolve, reject) => {
|
|
822
|
|
- uni.uploadFile({
|
|
823
|
|
- url: `${config.baseUrl}/common/upload`,
|
|
824
|
|
- filePath: event.tempFilePaths[0], // 取第一个文件
|
|
825
|
|
- name: 'file',
|
|
826
|
|
- header: { Authorization: 'Bearer ' + getToken() },
|
|
827
|
|
- formData: {
|
|
828
|
|
- // 可添加其他参数
|
|
829
|
|
- },
|
|
830
|
|
- success: (res) => resolve(JSON.parse(res.data)),
|
|
831
|
|
- fail: reject
|
|
|
834
|
+ return Promise.all(event.tempFilePaths.map(filePath => {
|
|
|
835
|
+ return new Promise((resolve, reject) => {
|
|
|
836
|
+ uni.uploadFile({
|
|
|
837
|
+ url: `${config.baseUrl}/common/upload`,
|
|
|
838
|
+ filePath: filePath,
|
|
|
839
|
+ name: 'file',
|
|
|
840
|
+ header: { Authorization: 'Bearer ' + getToken() },
|
|
|
841
|
+ formData: {
|
|
|
842
|
+ // 可添加其他参数
|
|
|
843
|
+ },
|
|
|
844
|
+ success: (res) => resolve(JSON.parse(res.data)),
|
|
|
845
|
+ fail: reject
|
|
|
846
|
+ });
|
|
832
|
847
|
});
|
|
833
|
|
- });
|
|
834
|
|
-
|
|
|
848
|
+ }));
|
|
835
|
849
|
},
|
|
836
|
850
|
|
|
837
|
851
|
formatDateTime(date) {
|
|
|
@@ -850,25 +864,25 @@ export default {
|
|
850
|
864
|
this.formData.securityLocation = arr[arr.length - 1]?.value || '';
|
|
851
|
865
|
this.formData.securityLocationText = arr.map(item => item.text).join('/');
|
|
852
|
866
|
const locationResult = this.getParentLocation(this.formData.securityLocation)
|
|
853
|
|
- console.log(locationResult);
|
|
854
|
|
-
|
|
855
|
|
- // 安全地处理可能为null的结果
|
|
856
|
|
- if (locationResult) {
|
|
857
|
|
- this.formData.terminlName = locationResult.grandParent?.text || '';
|
|
858
|
|
- this.formData.terminlCode = locationResult.grandParent?.value || '';
|
|
859
|
|
- this.formData.regionalName = locationResult.parent?.text || '';
|
|
860
|
|
- this.formData.regionalCode = locationResult.parent?.value || '';
|
|
861
|
|
- this.formData.channelName = locationResult.current?.text || '';
|
|
862
|
|
- this.formData.channelCode = locationResult.current?.value || '';
|
|
863
|
|
- } else {
|
|
864
|
|
- // 如果找不到位置信息,清空相关字段
|
|
865
|
|
- this.formData.terminlName = '';
|
|
866
|
|
- this.formData.terminlCode = '';
|
|
867
|
|
- this.formData.regionalName = '';
|
|
868
|
|
- this.formData.regionalCode = '';
|
|
869
|
|
- this.formData.channelName = '';
|
|
870
|
|
- this.formData.channelCode = '';
|
|
871
|
|
- }
|
|
|
867
|
+ console.log(locationResult);
|
|
|
868
|
+
|
|
|
869
|
+ // 安全地处理可能为null的结果
|
|
|
870
|
+ if (locationResult) {
|
|
|
871
|
+ this.formData.terminlName = locationResult.grandParent?.text || '';
|
|
|
872
|
+ this.formData.terminlCode = locationResult.grandParent?.value || '';
|
|
|
873
|
+ this.formData.regionalName = locationResult.parent?.text || '';
|
|
|
874
|
+ this.formData.regionalCode = locationResult.parent?.value || '';
|
|
|
875
|
+ this.formData.channelName = locationResult.current?.text || '';
|
|
|
876
|
+ this.formData.channelCode = locationResult.current?.value || '';
|
|
|
877
|
+ } else {
|
|
|
878
|
+ // 如果找不到位置信息,清空相关字段
|
|
|
879
|
+ this.formData.terminlName = '';
|
|
|
880
|
+ this.formData.terminlCode = '';
|
|
|
881
|
+ this.formData.regionalName = '';
|
|
|
882
|
+ this.formData.regionalCode = '';
|
|
|
883
|
+ this.formData.channelName = '';
|
|
|
884
|
+ this.formData.channelCode = '';
|
|
|
885
|
+ }
|
|
872
|
886
|
},
|
|
873
|
887
|
|
|
874
|
888
|
// 通用取值:只拿最后一级
|
|
|
@@ -1144,11 +1158,34 @@ export default {
|
|
1144
|
1158
|
padding: 15px;
|
|
1145
|
1159
|
}
|
|
1146
|
1160
|
|
|
|
1161
|
+ .collapse-card {
|
|
|
1162
|
+ border-radius: 12px;
|
|
|
1163
|
+ margin: 15px 0;
|
|
|
1164
|
+ box-shadow: rgba(0, 0, 0, 0.08) 0px 0px 3px 1px;
|
|
|
1165
|
+
|
|
|
1166
|
+ ::v-deep .uni-collapse-item__wrap {
|
|
|
1167
|
+ overflow: visible !important;
|
|
|
1168
|
+ border-radius: 12px;
|
|
|
1169
|
+ }
|
|
|
1170
|
+ }
|
|
|
1171
|
+
|
|
|
1172
|
+ .collapse-card-hidden {
|
|
|
1173
|
+ border-radius: 12px;
|
|
|
1174
|
+ margin: 15px 0;
|
|
|
1175
|
+ box-shadow: rgba(0, 0, 0, 0.08) 0px 0px 3px 1px;
|
|
|
1176
|
+
|
|
|
1177
|
+ ::v-deep .uni-collapse-item__wrap {
|
|
|
1178
|
+ overflow: hidden !important;
|
|
|
1179
|
+ border-radius: 12px;
|
|
|
1180
|
+ }
|
|
|
1181
|
+ }
|
|
|
1182
|
+
|
|
|
1183
|
+
|
|
1147
|
1184
|
.card {
|
|
1148
|
1185
|
border-radius: 12px;
|
|
1149
|
1186
|
overflow: hidden;
|
|
1150
|
1187
|
margin: 15px 0;
|
|
1151
|
|
- // overflow: visible;
|
|
|
1188
|
+
|
|
1152
|
1189
|
box-shadow: rgba(0, 0, 0, 0.08) 0px 0px 3px 1px;
|
|
1153
|
1190
|
|
|
1154
|
1191
|
.gridWrap {
|
|
|
@@ -1162,9 +1199,7 @@ export default {
|
|
1162
|
1199
|
border-radius: 16px;
|
|
1163
|
1200
|
}
|
|
1164
|
1201
|
|
|
1165
|
|
- // ::v-deep .uni-collapse-item__wrap {
|
|
1166
|
|
- // overflow: visible !important;
|
|
1167
|
|
- // }
|
|
|
1202
|
+
|
|
1168
|
1203
|
}
|
|
1169
|
1204
|
|
|
1170
|
1205
|
.userInfo {
|