syntec3-0-ui-components-test 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/S3_0UC_main.csv +4 -0
- package/dist/S3_0UC_sub.csv +2 -0
- package/dist/globalVariableS3_0UC.json +1 -0
- package/dist/style.css +1 -0
- package/dist/syntec3-0-ui-components.es.js +19518 -0
- package/dist/syntec3-0-ui-components.es.js.map +1 -0
- package/dist/syntec3-0-ui-components.umd.js +23 -0
- package/dist/syntec3-0-ui-components.umd.js.map +1 -0
- package/dist/vite.svg +1 -0
- package/dist/web.config +17 -0
- package/package.json +137 -0
- package/src/App.vue +31 -0
- package/src/assets/fonts/genYoGothicTW-normal.js +7 -0
- package/src/assets/image/defaultImage.png +0 -0
- package/src/assets/vue.svg +1 -0
- package/src/components/Layout/modules/fullPageGlobal.vue +113 -0
- package/src/components/Layout/modules/viewFile/config.js +65 -0
- package/src/components/Layout/modules/viewFile/createView.vue +1000 -0
- package/src/components/Layout/modules/viewFile/filterCriteria.vue +816 -0
- package/src/components/Layout/modules/viewFile/viewList.vue +291 -0
- package/src/components/Layout/modules/viewFile/viewManageTool.js +271 -0
- package/src/components/Layout/modules/viewFile/viewRecord.vue +472 -0
- package/src/components/Layout/modules/viewFile/viewTabs.vue +542 -0
- package/src/components/Layout/tools/GlobalDialog.vue +115 -0
- package/src/components/Pagination.vue +139 -0
- package/src/components/columnConfigNext.vue +273 -0
- package/src/components/customFilter/customFilter.vue +492 -0
- package/src/components/customFilter/filterCriteria.vue +769 -0
- package/src/components/customTable/components/headerOperation/index.vue +136 -0
- package/src/components/customTable/components/headerTabs/index.vue +171 -0
- package/src/components/customTable/components/tableContent/index.vue +440 -0
- package/src/components/customTable/index.vue +305 -0
- package/src/components/dialog.vue +85 -0
- package/src/components/pageContent.vue +48 -0
- package/src/components/popover.vue +402 -0
- package/src/configFiles/apiFile/baseApiList.json +11 -0
- package/src/configFiles/apiFile/coreApiList.json +24 -0
- package/src/configFiles/apiFile/mesApiList.json +4 -0
- package/src/configFiles/apiFile/mmsApiList.json +3 -0
- package/src/configFiles/errorCode.json +291 -0
- package/src/configFiles/version.js +2 -0
- package/src/i18n/lang/en-us.json +2060 -0
- package/src/i18n/lang/errorCodeTranslate.mjs +847 -0
- package/src/i18n/lang/zh-cn.json +2062 -0
- package/src/i18n/lang/zh-tw.json +2059 -0
- package/src/index.js +115 -0
- package/src/main.js +51 -0
- package/src/plugins/excel.js +88 -0
- package/src/router/index.js +41 -0
- package/src/scriptFiles/apiConfig/baseApis.js +10 -0
- package/src/scriptFiles/apiConfig/mesApis.js +10 -0
- package/src/scriptFiles/apiConfig/mmsApis.js +10 -0
- package/src/scriptFiles/apiConfig/privateCloudCoreApis.js +13 -0
- package/src/scriptFiles/apiConfig/serviceRoute.js +23 -0
- package/src/scriptFiles/apis/baseApiFunction.js +63 -0
- package/src/scriptFiles/apis/mesApiFunction.js +15 -0
- package/src/scriptFiles/apis/mmsApiFunction.js +9 -0
- package/src/scriptFiles/apis/privateCloudCoreApiFunction.js +101 -0
- package/src/scriptFiles/backendApiFunction.js +11 -0
- package/src/scriptFiles/checkApiErrorMechanism.js +137 -0
- package/src/scriptFiles/common/objectDataProcessing.js +65 -0
- package/src/scss/base/commom.scss +1068 -0
- package/src/scss/base/dialog.scss +45 -0
- package/src/scss/base/index.scss +3 -0
- package/src/scss/base/table.scss +28 -0
- package/src/store/index.js +25 -0
- package/src/store/module/langStore.js +116 -0
- package/src/style.css +52 -0
- package/src/utils/excel.js +86 -0
- package/src/utils/formula.js +69 -0
- package/src/utils/https.js +13 -0
- package/src/utils/i18n.js +42 -0
- package/src/utils/shiftSelect.js +164 -0
- package/src/utils/summation.js +77 -0
- package/src/utils/tableWidth.js +29 -0
- package/src/utils/toolFun.js +93 -0
- package/src/views/productionWorkOrder/components/columnConfig.vue +242 -0
- package/src/views/productionWorkOrder/components/docCustomFieldForm.vue +739 -0
- package/src/views/productionWorkOrder/components/filePreview.vue +148 -0
- package/src/views/productionWorkOrder/components/querySearch.vue +363 -0
- package/src/views/productionWorkOrder/configFiles/excelImportErrorCode.json +94 -0
- package/src/views/productionWorkOrder/configFiles/pdfDefaultConfig.js +933 -0
- package/src/views/productionWorkOrder/configFiles/planMakingScript.js +600 -0
- package/src/views/productionWorkOrder/configFiles/productionRelatedScript.js +368 -0
- package/src/views/productionWorkOrder/configFiles/rulse.js +23 -0
- package/src/views/productionWorkOrder/configFiles/status.js +50 -0
- package/src/views/productionWorkOrder/index.vue +2174 -0
- package/src/views/productionWorkOrder/productionFlowLabel/component/addCirculationLabel.vue +394 -0
- package/src/views/productionWorkOrder/productionFlowLabel/component/circulationLabelTable.vue +124 -0
- package/src/views/productionWorkOrder/productionFlowLabel/component/materialPartFilePreview.vue +167 -0
- package/src/views/productionWorkOrder/productionFlowLabel/component/workOrderInformation.vue +28 -0
- package/src/views/productionWorkOrder/productionFlowLabel/index.vue +604 -0
- package/src/views/production_work_order/components/priorityTooltip.vue +53 -0
- package/src/views/production_work_order/index.vue +1307 -0
- package/src/views/review_record/components/materialInfo.vue +50 -0
- package/src/views/review_record/components/rootCause.vue +42 -0
- package/src/views/review_record/components/workDetail.vue +115 -0
- package/src/views/review_record/index.vue +884 -0
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-loading="!isLoad" data-test-id="DIV-Ydf0yz">
|
|
3
|
+
<div data-test-id="DIV-uWyNOt">
|
|
4
|
+
<el-row data-test-id="EL-ROW-Qs8O6C">
|
|
5
|
+
<el-col :span="15" data-test-id="EL-COL-7SqxcZ">
|
|
6
|
+
<filterCriteria
|
|
7
|
+
v-if="isLoad"
|
|
8
|
+
ref="defaultFilterRef"
|
|
9
|
+
:is-it-default="true"
|
|
10
|
+
:filter-conditions="defaultFilterConditions"
|
|
11
|
+
:other-filter-conditions="extraFilterConditions"
|
|
12
|
+
:field-setting="fieldSetting"
|
|
13
|
+
:select-options="selectOptions"
|
|
14
|
+
data-test-id="FILTERCRITERIA-1hVwQx"
|
|
15
|
+
/>
|
|
16
|
+
</el-col>
|
|
17
|
+
<el-col :span="9" align="center" data-test-id="EL-COL-jTNbYx">
|
|
18
|
+
<div class="button-container" data-test-id="DIV-jtoMT9">
|
|
19
|
+
<el-button type="primary" data-test-id="EL-BUTTON-heY1hB" @click="handleSearch(true)">
|
|
20
|
+
<i class="mdi mdi-magnify" data-test-id="I-tbxET9" />
|
|
21
|
+
{{ t('query') }}
|
|
22
|
+
</el-button>
|
|
23
|
+
<el-popover
|
|
24
|
+
ref="popoverRef"
|
|
25
|
+
:visible="visible"
|
|
26
|
+
placement="bottom-start"
|
|
27
|
+
width="800"
|
|
28
|
+
trigger="click"
|
|
29
|
+
data-test-id="EL-POPOVER-fMMv4b"
|
|
30
|
+
>
|
|
31
|
+
<div v-loading="loading" data-test-id="DIV-u82ZkA">
|
|
32
|
+
<filterCriteria
|
|
33
|
+
v-if="visible"
|
|
34
|
+
ref="extraFilterRef"
|
|
35
|
+
:is-it-default="false"
|
|
36
|
+
:filter-conditions="extraFilterConditions"
|
|
37
|
+
:other-filter-conditions="defaultFilterConditions"
|
|
38
|
+
:field-setting="fieldSetting"
|
|
39
|
+
:select-options="selectOptions"
|
|
40
|
+
data-test-id="FILTERCRITERIA-1hVwQx"
|
|
41
|
+
/>
|
|
42
|
+
<el-text
|
|
43
|
+
class="title-content cursor mx-1"
|
|
44
|
+
type="primary"
|
|
45
|
+
data-test-id="EL-TEXT-fiYiUY"
|
|
46
|
+
@click="addFilterCondition"
|
|
47
|
+
>
|
|
48
|
+
<v-icon class="mdi mdi-plus" data-test-id="V-ICON-RTH8U1" />
|
|
49
|
+
{{ t('addFilterCriteria') }}
|
|
50
|
+
</el-text>
|
|
51
|
+
</div>
|
|
52
|
+
<template #reference>
|
|
53
|
+
<el-button data-test-id="EL-BUTTON-AzDm8o" @click="handleMoreFilter">
|
|
54
|
+
<i class="mdi mdi-cog" data-test-id="I-tbxET9" />
|
|
55
|
+
{{ t('moreFilter') }}
|
|
56
|
+
</el-button>
|
|
57
|
+
</template>
|
|
58
|
+
</el-popover>
|
|
59
|
+
<el-button data-test-id="EL-BUTTON-f5txPo" @click="handleReset">{{ t('reset') }}</el-button>
|
|
60
|
+
<columnConfigNext
|
|
61
|
+
v-if="hasColumnConfig"
|
|
62
|
+
:parent-items="canEditHeaders"
|
|
63
|
+
:is-parent-checkbox="true"
|
|
64
|
+
:is-child-checkbox="false"
|
|
65
|
+
:is-child="false"
|
|
66
|
+
data-test-id="COLUMNCONFIGNEXT-fZb3uK"
|
|
67
|
+
@parentSaveData="parentSaveData"
|
|
68
|
+
@childSaveData="childSaveData"
|
|
69
|
+
/>
|
|
70
|
+
</div>
|
|
71
|
+
</el-col>
|
|
72
|
+
</el-row>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</template>
|
|
76
|
+
|
|
77
|
+
<script setup>
|
|
78
|
+
import { computed, ref, onMounted, nextTick, onBeforeUnmount, watch } from 'vue';
|
|
79
|
+
import { useI18n } from 'vue-i18n';
|
|
80
|
+
import columnConfigNext from '@/components/columnConfigNext.vue';
|
|
81
|
+
import filterCriteria from '@/components/customFilter/filterCriteria.vue';
|
|
82
|
+
import apiFunction from '@/scriptFiles/checkApiErrorMechanism';
|
|
83
|
+
import { ElMessage } from 'element-plus';
|
|
84
|
+
const { t } = useI18n();
|
|
85
|
+
const emit = defineEmits(['filterSearch', 'parentSaveData', 'childSaveData']);
|
|
86
|
+
const props = defineProps({
|
|
87
|
+
hasColumnConfig: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: true,
|
|
90
|
+
},
|
|
91
|
+
canEditHeaders: Array,
|
|
92
|
+
permissionCode: String,
|
|
93
|
+
selectOptions: {
|
|
94
|
+
type: Object,
|
|
95
|
+
default: () => ({}),
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
const isLoad = ref(false);
|
|
99
|
+
const visible = ref(false);
|
|
100
|
+
/* 列配置 */
|
|
101
|
+
const canEditHeaders = computed(() => props.canEditHeaders);
|
|
102
|
+
/* 权限编码 */
|
|
103
|
+
const permissionCode = computed(() => props.permissionCode);
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* 类配置修改
|
|
107
|
+
* @param {*} val
|
|
108
|
+
*/
|
|
109
|
+
const parentSaveData = (val) => {
|
|
110
|
+
emit('parentSaveData', val);
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* 子级数据保存
|
|
114
|
+
* @param {*} val
|
|
115
|
+
*/
|
|
116
|
+
const childSaveData = (val) => {
|
|
117
|
+
emit('childSaveData', val);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/* 过滤条件 */
|
|
121
|
+
const filterConditions = ref([]);
|
|
122
|
+
const defaultFilterConditions = ref([]); //外部默认筛选条件
|
|
123
|
+
const extraFilterConditions = ref([]); //内部额外筛选条件
|
|
124
|
+
/**
|
|
125
|
+
* 获取自定义筛选条件
|
|
126
|
+
*/
|
|
127
|
+
const fetchFilterConditions = async () => {
|
|
128
|
+
try {
|
|
129
|
+
const {
|
|
130
|
+
data: { code, message, content },
|
|
131
|
+
} = await apiFunction.queryFilterCondition({ permissionCode: permissionCode.value });
|
|
132
|
+
if (code !== 0) {
|
|
133
|
+
ElMessage.error(t(message));
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (
|
|
137
|
+
content.data.filterCondition === '' ||
|
|
138
|
+
content.data.filterCondition === '[]' ||
|
|
139
|
+
content.data.filterCondition === null
|
|
140
|
+
) {
|
|
141
|
+
defaultFilterConditions.value = [
|
|
142
|
+
{
|
|
143
|
+
Operator: null,
|
|
144
|
+
IsCustomSetting: null,
|
|
145
|
+
DocCustomId: null,
|
|
146
|
+
ColumnType: null,
|
|
147
|
+
TextValue: null,
|
|
148
|
+
NumberValue: null,
|
|
149
|
+
NumberRangeValue: [],
|
|
150
|
+
CloumnName: null,
|
|
151
|
+
SelectRangeValue: [],
|
|
152
|
+
SingleSelectValue: null,
|
|
153
|
+
DateTimeOperatorValue: { TimeType: null, TimeValue: null },
|
|
154
|
+
DateTimeRangeValue: { TimeType: null, TimeValue: [] },
|
|
155
|
+
DateTimeDynamicFilteringValue: {
|
|
156
|
+
DateType: null,
|
|
157
|
+
},
|
|
158
|
+
DateTimeDynamicFilteringCustomize: [
|
|
159
|
+
{
|
|
160
|
+
PastOrFuture: null,
|
|
161
|
+
NumberValue: null,
|
|
162
|
+
DayType: null,
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
PastOrFuture: null,
|
|
166
|
+
NumberValue: null,
|
|
167
|
+
DayType: null,
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
},
|
|
171
|
+
];
|
|
172
|
+
extraFilterConditions.value = [];
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
filterConditions.value = JSON.parse(content.data.filterCondition);
|
|
176
|
+
defaultFilterConditions.value = [filterConditions.value[0]];
|
|
177
|
+
extraFilterConditions.value = filterConditions.value.length === 1 ? [] : filterConditions.value.slice(1, 10);
|
|
178
|
+
} catch (error) {
|
|
179
|
+
ElMessage.error(t('apiError'));
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* 添加筛选条件
|
|
184
|
+
*/
|
|
185
|
+
const addFilterCondition = () => {
|
|
186
|
+
if (extraFilterConditions.value.length >= 9) {
|
|
187
|
+
ElMessage.error(t('maxFilterConditions'));
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
extraFilterConditions.value.push({
|
|
191
|
+
Operator: null,
|
|
192
|
+
IsCustomSetting: null,
|
|
193
|
+
DocCustomId: null,
|
|
194
|
+
ColumnType: null,
|
|
195
|
+
TextValue: null,
|
|
196
|
+
NumberValue: null,
|
|
197
|
+
NumberRangeValue: [],
|
|
198
|
+
CloumnName: null,
|
|
199
|
+
SelectRangeValue: [],
|
|
200
|
+
SingleSelectValue: null,
|
|
201
|
+
DateTimeOperatorValue: { TimeType: null, TimeValue: null },
|
|
202
|
+
DateTimeRangeValue: { TimeType: null, TimeValue: [] },
|
|
203
|
+
DateTimeDynamicFilteringValue: {
|
|
204
|
+
DateType: null,
|
|
205
|
+
},
|
|
206
|
+
DateTimeDynamicFilteringCustomize: [
|
|
207
|
+
{
|
|
208
|
+
PastOrFuture: null,
|
|
209
|
+
NumberValue: null,
|
|
210
|
+
DayType: null,
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
PastOrFuture: null,
|
|
214
|
+
NumberValue: null,
|
|
215
|
+
DayType: null,
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
/* 查询自定义筛选字段内容 */
|
|
221
|
+
const fieldSetting = ref([]);
|
|
222
|
+
/**
|
|
223
|
+
* 获取自定义筛选字段内容
|
|
224
|
+
* @param permissionCode 权限编码
|
|
225
|
+
*/
|
|
226
|
+
const getFieldSetting = async (permissionCode) => {
|
|
227
|
+
try {
|
|
228
|
+
const {
|
|
229
|
+
data: { code, content, message },
|
|
230
|
+
} = await apiFunction.getFieldSetting(permissionCode);
|
|
231
|
+
if (code !== 0) {
|
|
232
|
+
ElMessage.error(t(message));
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const docCustomSettings = content.docCustomSettings.map((item) => ({
|
|
236
|
+
fieldName: item.fieldName,
|
|
237
|
+
fieldTypeId: item.fieldTypeId,
|
|
238
|
+
fieldSelectOptions: item.fieldSelectOptions,
|
|
239
|
+
key: item.docCustomId,
|
|
240
|
+
isDoc: true,
|
|
241
|
+
}));
|
|
242
|
+
const fieldSettings = content.fieldSettings.map((item) => ({
|
|
243
|
+
fieldName: item.fieldKey,
|
|
244
|
+
fieldTypeId: item.fieldTypeId,
|
|
245
|
+
fieldSelectOptions: item.fieldSelectOptions,
|
|
246
|
+
key: item.fieldKey,
|
|
247
|
+
isDoc: false,
|
|
248
|
+
}));
|
|
249
|
+
fieldSetting.value = [...fieldSettings, ...docCustomSettings];
|
|
250
|
+
} catch (error) {
|
|
251
|
+
ElMessage.error(t('apiError'));
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
/* 查询 */
|
|
256
|
+
const defaultFilterRef = ref(null);
|
|
257
|
+
const extraFilterRef = ref(null);
|
|
258
|
+
const loading = ref(false);
|
|
259
|
+
/**
|
|
260
|
+
* 校验筛选条件
|
|
261
|
+
*/
|
|
262
|
+
const validate = async () => {
|
|
263
|
+
try {
|
|
264
|
+
const defaultValidate = (await defaultFilterRef.value?.validateAllForms()) ?? true;
|
|
265
|
+
const extraValidate = (await extraFilterRef.value?.validateAllForms()) ?? true;
|
|
266
|
+
return defaultValidate && extraValidate;
|
|
267
|
+
} catch (error) {
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* 保存更多筛选条件
|
|
273
|
+
*/
|
|
274
|
+
const handleSaveExtraFilter = async () => {
|
|
275
|
+
isLoad.value = false;
|
|
276
|
+
loading.value = true;
|
|
277
|
+
try {
|
|
278
|
+
const valid = await validate();
|
|
279
|
+
if (!valid) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
const {
|
|
283
|
+
data: { code, message },
|
|
284
|
+
} = await apiFunction.insertOrUpdateFilterCondition({
|
|
285
|
+
permissionCode: permissionCode.value,
|
|
286
|
+
filterCondition: JSON.stringify(
|
|
287
|
+
[...defaultFilterConditions.value, ...extraFilterConditions.value]
|
|
288
|
+
.filter((item) => item.CloumnName !== null)
|
|
289
|
+
.map((it) => ({
|
|
290
|
+
...it,
|
|
291
|
+
NumberRangeValue: it.NumberRangeValue.every((num) => num === null) ? [] : it.NumberRangeValue,
|
|
292
|
+
})),
|
|
293
|
+
),
|
|
294
|
+
});
|
|
295
|
+
if (code !== 0) {
|
|
296
|
+
ElMessage.error(t(message));
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
await fetchFilterConditions();
|
|
300
|
+
visible.value = false;
|
|
301
|
+
} catch (error) {
|
|
302
|
+
ElMessage.error(t('apiError'));
|
|
303
|
+
} finally {
|
|
304
|
+
loading.value = false;
|
|
305
|
+
isLoad.value = true;
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* 筛选查询
|
|
310
|
+
* @param type
|
|
311
|
+
*/
|
|
312
|
+
const handleSearch = async (type) => {
|
|
313
|
+
if (type) {
|
|
314
|
+
await handleSaveExtraFilter();
|
|
315
|
+
}
|
|
316
|
+
// 获取筛选条件数据
|
|
317
|
+
const defaultConditions = defaultFilterRef.value?.filterConditions || [];
|
|
318
|
+
const extraConditions = extraFilterRef.value?.filterConditions || [];
|
|
319
|
+
|
|
320
|
+
// 合并筛选条件
|
|
321
|
+
const filterData = {
|
|
322
|
+
defaultConditions,
|
|
323
|
+
extraConditions,
|
|
324
|
+
};
|
|
325
|
+
emit('filterSearch', filterData);
|
|
326
|
+
};
|
|
327
|
+
/**
|
|
328
|
+
* 更多筛选条件
|
|
329
|
+
*/
|
|
330
|
+
const handleMoreFilter = () => {
|
|
331
|
+
visible.value = !visible.value;
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
// 添加点击外部区域关闭弹窗的逻辑
|
|
335
|
+
const popoverRef = ref(null);
|
|
336
|
+
const referenceRef = ref(null);
|
|
337
|
+
|
|
338
|
+
const handleClickOutside = (event) => {
|
|
339
|
+
if (visible.value) {
|
|
340
|
+
const popoverEl = popoverRef.value?.$el;
|
|
341
|
+
const referenceEl = referenceRef.value?.$el || document.querySelector('[data-test-id="EL-BUTTON-AzDm8o"]');
|
|
342
|
+
if (popoverEl && referenceEl) {
|
|
343
|
+
// 检查点击的元素是否在弹窗或引用元素内部
|
|
344
|
+
const isClickInside = popoverEl.contains(event.target) || referenceEl.contains(event.target);
|
|
345
|
+
// 检查点击的元素是否是Element Plus的弹出组件(如日期选择器、下拉菜单等)
|
|
346
|
+
let isClickOnPopper = false;
|
|
347
|
+
let target = event.target;
|
|
348
|
+
// 向上遍历DOM树,检查是否是popper组件
|
|
349
|
+
while (target) {
|
|
350
|
+
if (
|
|
351
|
+
target.classList?.contains('el-popper') ||
|
|
352
|
+
target.classList?.contains('el-date-editor') ||
|
|
353
|
+
target.dataset?.testId?.includes('EL-DATE-PICKER') ||
|
|
354
|
+
target.dataset?.testId?.includes('EL-SELECT')
|
|
355
|
+
) {
|
|
356
|
+
isClickOnPopper = true;
|
|
357
|
+
break;
|
|
358
|
+
}
|
|
359
|
+
target = target.parentElement;
|
|
360
|
+
}
|
|
361
|
+
// 检查点击的元素是否在弹窗的子组件内部
|
|
362
|
+
const isClickInFilterCriteria = event.target.closest('[data-test-id="FILTERCRITERIA-1hVwQx"]');
|
|
363
|
+
// 只有当点击确实在弹窗外部且不是弹窗的子组件或popper组件时,才关闭弹窗
|
|
364
|
+
if (!isClickInside && !isClickOnPopper && !isClickInFilterCriteria) {
|
|
365
|
+
visible.value = false;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
// 监听visible变化,添加或移除事件监听器
|
|
372
|
+
watch(visible, (newVal) => {
|
|
373
|
+
if (newVal) {
|
|
374
|
+
// 在下一个事件循环添加监听器,避免触发点击事件
|
|
375
|
+
setTimeout(() => {
|
|
376
|
+
document.addEventListener('click', handleClickOutside);
|
|
377
|
+
}, 0);
|
|
378
|
+
} else {
|
|
379
|
+
document.removeEventListener('click', handleClickOutside);
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
/**
|
|
383
|
+
* 重置筛选条件
|
|
384
|
+
*/
|
|
385
|
+
const handleReset = async () => {
|
|
386
|
+
isLoad.value = false;
|
|
387
|
+
loading.value = true;
|
|
388
|
+
filterConditions.value = [];
|
|
389
|
+
defaultFilterConditions.value = [];
|
|
390
|
+
extraFilterConditions.value = [];
|
|
391
|
+
try {
|
|
392
|
+
const {
|
|
393
|
+
data: { code, message },
|
|
394
|
+
} = await apiFunction.insertOrUpdateFilterCondition({
|
|
395
|
+
permissionCode: permissionCode.value,
|
|
396
|
+
filterCondition: null,
|
|
397
|
+
});
|
|
398
|
+
if (code !== 0) {
|
|
399
|
+
ElMessage.error(t(message));
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
await fetchFilterConditions();
|
|
403
|
+
await handleSearch(false);
|
|
404
|
+
visible.value = false;
|
|
405
|
+
} catch (error) {
|
|
406
|
+
ElMessage.error(t('apiError'));
|
|
407
|
+
} finally {
|
|
408
|
+
loading.value = false;
|
|
409
|
+
isLoad.value = true;
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
defineExpose({
|
|
414
|
+
handleSearch,
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
onMounted(async () => {
|
|
418
|
+
await nextTick();
|
|
419
|
+
await getFieldSetting(permissionCode.value);
|
|
420
|
+
await fetchFilterConditions();
|
|
421
|
+
const stockViewQueryDataObj = window.stockViewQueryDataObj;
|
|
422
|
+
let searchObj = {};
|
|
423
|
+
if (stockViewQueryDataObj) {
|
|
424
|
+
searchObj = stockViewQueryDataObj.searchObj;
|
|
425
|
+
}
|
|
426
|
+
if (searchObj?.sourceOrderNumber) {
|
|
427
|
+
isLoad.value = false;
|
|
428
|
+
loading.value = true;
|
|
429
|
+
filterConditions.value = [
|
|
430
|
+
{
|
|
431
|
+
Operator: 5,
|
|
432
|
+
IsCustomSetting: false,
|
|
433
|
+
DocCustomId: null,
|
|
434
|
+
ColumnType: 1,
|
|
435
|
+
TextValue: searchObj.sourceOrderNumber,
|
|
436
|
+
NumberValue: null,
|
|
437
|
+
NumberRangeValue: [],
|
|
438
|
+
CloumnName: 'productionOrderNumber',
|
|
439
|
+
SelectRangeValue: [],
|
|
440
|
+
SingleSelectValue: null,
|
|
441
|
+
DateTimeOperatorValue: { TimeType: null, TimeValue: null },
|
|
442
|
+
DateTimeRangeValue: { TimeType: null, TimeValue: [] },
|
|
443
|
+
DateTimeDynamicFilteringValue: {
|
|
444
|
+
DateType: null,
|
|
445
|
+
},
|
|
446
|
+
DateTimeDynamicFilteringCustomize: [
|
|
447
|
+
{
|
|
448
|
+
PastOrFuture: null,
|
|
449
|
+
NumberValue: null,
|
|
450
|
+
DayType: null,
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
PastOrFuture: null,
|
|
454
|
+
NumberValue: null,
|
|
455
|
+
DayType: null,
|
|
456
|
+
},
|
|
457
|
+
],
|
|
458
|
+
},
|
|
459
|
+
];
|
|
460
|
+
defaultFilterConditions.value = [filterConditions.value[0]];
|
|
461
|
+
extraFilterConditions.value = filterConditions.value.length === 1 ? [] : filterConditions.value.slice(1, 10);
|
|
462
|
+
await handleSearch(true);
|
|
463
|
+
loading.value = false;
|
|
464
|
+
isLoad.value = true;
|
|
465
|
+
}
|
|
466
|
+
isLoad.value = true;
|
|
467
|
+
});
|
|
468
|
+
onBeforeUnmount(() => {
|
|
469
|
+
delete window.stockViewQueryDataObj;
|
|
470
|
+
// 移除事件监听器
|
|
471
|
+
document.removeEventListener('click', handleClickOutside);
|
|
472
|
+
});
|
|
473
|
+
</script>
|
|
474
|
+
|
|
475
|
+
<style scoped>
|
|
476
|
+
.el-form-item__content {
|
|
477
|
+
width: 100%;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.title-content {
|
|
481
|
+
max-width: 50%;
|
|
482
|
+
display: inline-block;
|
|
483
|
+
white-space: nowrap;
|
|
484
|
+
overflow: hidden;
|
|
485
|
+
text-overflow: ellipsis;
|
|
486
|
+
line-height: 20px !important;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.cursor {
|
|
490
|
+
cursor: pointer;
|
|
491
|
+
}
|
|
492
|
+
</style>
|