|
|
@@ -69,8 +69,17 @@
|
|
|
<el-option v-for="dict in inspection_type_dict" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="门店" prop="storeName">
|
|
|
- <el-input v-model="queryParams.storeName" placeholder="请输入门店" clearable style="width: 180px" @keyup.enter="handleQuery" />
|
|
|
+ <el-form-item label="门店" prop="storeId">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.storeId"
|
|
|
+ placeholder="全部"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ style="width: 200px"
|
|
|
+ @change="handleQuery"
|
|
|
+ >
|
|
|
+ <el-option v-for="d in storeOptions" :key="d.value" :label="d.label" :value="d.value" />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="打卡状态" prop="recordStatus">
|
|
|
<el-select v-model="queryParams.recordStatus" placeholder="全部" clearable style="width: 180px">
|
|
|
@@ -476,6 +485,7 @@ import type {
|
|
|
} from '@/api/risk/types';
|
|
|
import { listByCurrentDeptChainUsers } from '@/api/system/user';
|
|
|
import type { UserVO } from '@/api/system/user/types';
|
|
|
+import { listDept } from '@/api/system/dept';
|
|
|
import { FormInstance } from 'element-plus';
|
|
|
import type { ComponentInternalInstance } from 'vue';
|
|
|
import { Calendar, Check, Warning, Clock } from '@element-plus/icons-vue';
|
|
|
@@ -500,6 +510,8 @@ const recordList = ref<RiskInspectionRecordVo[]>([]);
|
|
|
const recordLoading = ref(false);
|
|
|
// 责任人/审核人选择器数据(当前登录用户所在部门及所有下级部门用户)
|
|
|
const deptChainUserOptions = ref<UserVO[]>([]);
|
|
|
+// 门店下拉(集团总部 + 65 个门店,dept_category='门店')
|
|
|
+const storeOptions = ref<Array<{ label: string; value: number }>>([]);
|
|
|
// 字典
|
|
|
const {
|
|
|
risk_inspection_type: inspection_type_dict,
|
|
|
@@ -569,7 +581,7 @@ const data = reactive<any>({
|
|
|
pageSize: 10,
|
|
|
taskName: '',
|
|
|
taskType: '',
|
|
|
- storeName: '',
|
|
|
+ storeId: undefined as number | undefined,
|
|
|
recordStatus: '',
|
|
|
checkResult: ''
|
|
|
},
|
|
|
@@ -622,6 +634,7 @@ const handleQuery = () => {
|
|
|
const resetQuery = () => {
|
|
|
queryFormRef.value?.resetFields();
|
|
|
queryParams.value.pageNum = 1;
|
|
|
+ queryParams.value.storeId = undefined as number | undefined;
|
|
|
handleQuery();
|
|
|
};
|
|
|
|
|
|
@@ -963,7 +976,25 @@ const getResultTag = (r: string): 'primary' | 'success' | 'warning' | 'info' | '
|
|
|
onMounted(async () => {
|
|
|
await loadAll();
|
|
|
await loadDeptChainUsers();
|
|
|
+ await loadStores();
|
|
|
});
|
|
|
+
|
|
|
+/** 加载门店下拉(集团总部 + dept_category='门店' 的所有门店) */
|
|
|
+const loadStores = async () => {
|
|
|
+ try {
|
|
|
+ const res: any = await listDept({});
|
|
|
+ const list: any[] = Array.isArray(res?.data) ? res.data : Array.isArray(res) ? res : [];
|
|
|
+ // 总部(dept_id=100 '家得福集团总部') + 所有 dept_category='门店' 的门店
|
|
|
+ storeOptions.value = list
|
|
|
+ .filter((d: any) => d.deptCategory === '门店' || d.deptId === 100)
|
|
|
+ .filter((d: any) => d.status === '0' || d.status === undefined || d.status === null)
|
|
|
+ .map((d: any) => ({ label: d.deptName, value: d.deptId }))
|
|
|
+ .sort((a, b) => a.value - b.value);
|
|
|
+ } catch (e) {
|
|
|
+ console.error('加载门店列表失败', e);
|
|
|
+ storeOptions.value = [];
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|