From ea18b23aff986d6218a7f3baab52afe45b3212a3 Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Thu, 30 Oct 2025 16:03:11 +0800 Subject: [PATCH] 1 --- pages/apply/jobList.vue | 140 +++++++++++++++++++++++++++------------- pages/index/index.vue | 17 ++--- 2 files changed, 102 insertions(+), 55 deletions(-) diff --git a/pages/apply/jobList.vue b/pages/apply/jobList.vue index f086549..bbe7162 100644 --- a/pages/apply/jobList.vue +++ b/pages/apply/jobList.vue @@ -17,7 +17,7 @@ - + @@ -26,40 +26,60 @@ 岗位风险清单 - - - - - - - + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - 生产岗位告知卡 + 生成岗位告知卡 @@ -89,6 +109,7 @@ pageIndex: 0, pageSize: 20, total: 0, + loading:true, baseUrl: config.uni_app_web_source_url, allData: [], // 新增选中项数组,存储选中item的唯一标识 @@ -99,22 +120,12 @@ Nav_Librarys: [] }, model: { - RISK_AREA_NAME: '请选择区域', - RISK_AREA_ID: '', - ISDOWN: '否', - SchedulingType: '', - COUNT_WORKER: '', - COUNT_LEVEL: '', - START_TIME: '', - END_TIME: '', - SchedulingNEXTTIME: '', - LISTPERSON_SCHEDULING: [{ + Nav_Post: { NAME: '' - }], - LISTUSER_LEAVE: [{ + }, + Nav_Department: { NAME: '' - }], - ListShow: [] + }, }, radiolist: [{ value: false, @@ -141,6 +152,10 @@ }, onLoad(option) { this.OrgId = option.OrgId // 'B043B28B-BBC3-C452-6052-4FBA1457ABFA' + this.model.DEPARTMENT_ID = option.DEPARTMENT_ID + this.model.POST_ID = option.POST_ID + this.inntData() + // const orgId = uni.getStorageSync('orgId') this.fetchEnums(['SKEvaluateLevelEnum', 'SKProductionUnit']); }, @@ -149,6 +164,29 @@ // this.$refs.uForm.setRules(this.rules) // }, methods: { + inntData() { + if (this.model.DEPARTMENT_ID) { + const json = initFilter(this.OrgId, null, "NAME", 0, 1) + json.IgnoreDataRule = true + extendRule(json, "ID", 1, this.model.DEPARTMENT_ID) + DepartOrderPaged(json).then(res => { + if (res != undefined && res.Data.length > 0) { + this.model.Nav_Department.NAME = res.Data[0].NAME + } + }) + } + if (this.model.POST_ID) { + const jsons = initFilter(this.OrgId, null, "NAME", 0, 1) + jsons.IgnoreDataRule = true + extendRule(jsons, "ID", 1, this.model.POST_ID) + PostOrderPaged(jsons).then(res => { + if (res != undefined && res.Data.length > 0) { + this.model.Nav_Post.NAME = res.Data[0].NAME + } + }) + } + + }, async fetchEnums(enumNames) { try { // 存储所有枚举请求的Promise @@ -193,6 +231,7 @@ const json = initFilter(this.OrgId, "", "") json.IgnoreDataRule = true GetPostRiskList(json).then(res => { + this.loading = false this.allData = res.Data this.allData.map(item => { if (item.Nav_Librarys && item.Nav_Librarys.length > 0) { @@ -206,7 +245,9 @@ } }) // this.total = res.TotalCount - + if (this.model.DEPARTMENT_ID && this.model.POST_ID) { + this.filterData() + } }) @@ -278,9 +319,18 @@ } }, filterData() { + + if (!this.model.DEPARTMENT_ID || !this.model.POST_ID) { + uni.showToast({ + icon: 'error', + title: '请选择部门和岗位' + }) + return + } this.checkedItems = [] this.allData.map(item => { - if (item.DEPARTMENT_ID == this.model.DEPARTMENT_ID && item.POST_NAME == this.model.Nav_Post.NAME) { + // item.POST_ID == this.model.POST_ID + if (item.DEPARTMENT_ID == this.model.DEPARTMENT_ID && item.POST_ID == this.model.POST_ID) { this.$set(this, 'filterDatas', item); this.$nextTick(() => { // 等待 DOM 渲染新数据后再全选 const allIds = this.filterDatas.Nav_Librarys.map(item1 => item1.ID); @@ -289,10 +339,10 @@ } }) - if(!this.filterDatas||!this.filterDatas.Nav_Librarys||this.filterDatas.Nav_Librarys.length==0){ + if (!this.filterDatas || !this.filterDatas.Nav_Librarys || this.filterDatas.Nav_Librarys.length == 0) { uni.showToast({ - icon:'error', - title:'暂无当前岗位数据' + icon: 'error', + title: '暂无当前岗位数据', }) } }, diff --git a/pages/index/index.vue b/pages/index/index.vue index e70e1c4..0a65cd3 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -2,26 +2,21 @@ - - - + + + - + {{baseListItem.name}} - @@ -148,6 +143,8 @@ urlTo += '&RISK_AREA_ID=' + this.RISK_AREA_ID if (this.DEPARTMENT_ID && this.DEPARTMENT_ID != undefined && this.DEPARTMENT_ID.length > 1) urlTo += '&DEPARTMENT_ID=' + this.DEPARTMENT_ID + if (this.POST_ID && this.POST_ID != undefined && this.POST_ID.length > 1) + urlTo += '&POST_ID=' + this.POST_ID uni.navigateTo({ url: urlTo