diff --git a/src/views/business-examine/direct-rotation-apply/index.vue b/src/views/business-examine/direct-rotation-apply/index.vue index 12d76c9f..fcff6b4c 100644 --- a/src/views/business-examine/direct-rotation-apply/index.vue +++ b/src/views/business-examine/direct-rotation-apply/index.vue @@ -120,7 +120,7 @@ export default { pageNum: 1, pageSize: 10, keyWord: '', // 关键字 - status: '' // 审核状态 + status: '1' // 审核状态 }, // 状态 statusOptions: [ @@ -144,10 +144,10 @@ export default { }, created() { this.userId = sessionStorage.getItem('userId') - // 设置默认状态为第一个选项(待审核) - if (this.statusOptions.length > 0) { - this.queryParams.status = this.statusOptions[0].value - } + // // 设置默认状态为第一个选项(待审核) + // if (this.statusOptions.length > 1) { + // this.queryParams.status = this.statusOptions[1].value + // } this.getList() }, methods: { diff --git a/src/views/business-examine/receive-apply/business-details.vue b/src/views/business-examine/receive-apply/business-details.vue index a7f3c9d0..bd116c3c 100644 --- a/src/views/business-examine/receive-apply/business-details.vue +++ b/src/views/business-examine/receive-apply/business-details.vue @@ -161,94 +161,35 @@ export default { } }, async created() { - const origin = window.location.href - console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",origin) - // if (origin.indexOf('ticket') != -1) { - // console.log("11111111111111111111111111",origin) - // await this.getConfigApi() //领料工单 - // try { - // console.log("hhhhhhhhhhhhhhhhhhhhhh",origin) - // const urlParams = new URLSearchParams(origin); - // console.log("urlParamshhhhhhhhhhhhhhh",urlParams) - // this.auditingParams.taskId = urlParams.get('taskId'); - // const id = urlParams.get('id'); - // console.log("idhhhhhhhhhhhhhhh",id) - // const ticketMatch = origin.match(/ticket=([^&]*)/); - // console.log("ticket11111111111111111111",ticketMatch) - // const ticket = ticketMatch ? ticketMatch[1] : ''; - // const res = await iwsLogin({ - // ticket: ticket, - // sysType: 0 - // }) - // console.log('🚀 ~ created ~ resxxxxxxxxxxxxxxx:', res) - // // 1. 获取token并存储 - // if (res.code == 200) { - // setToken(res.data.access_token) - // this.$store.commit('SET_TOKEN', res.data.access_token) - // setExpiresIn(1800) - // this.$store.commit('SET_EXPIRES_IN', 1800) - // } - // // 2. 获取用户信息并存储 - // const resUser = await getInfo() - // // 存取用户的userId - // sessionStorage.setItem('userId', resUser.user?.userId) - // sessionStorage.setItem('deptName', resUser.user?.dept?.deptName) - // // sessionStorage.setItem('userName', resUser.user?.userName) - - // this.userId = sessionStorage.getItem('userId') - // console.log("yyyyyyyyyyyyyyyuserId",this.userId) - // await this.getLeaseTaskDetailFun(id, this.auditingParams.taskId) - // // setExpiresIn(res.data.expires_in) - // // this.$store.commit('SET_EXPIRES_IN', res.data.expires_in) - - - // } catch (error) { - // console.log('🚀 ~ created ~ error:', error) - // this.$message({ - // message: '登录失败, 即将关闭页面', - // type: 'error' - // }) - // // setTimeout(() => { - // // // 关闭窗口 - // // window.close() - // // }, 1500) - // } - // }else{ - // 判断当前路由页面是否有查询参数 - if (this.$route.query) { - const { id, taskId, type } = this.$route.query - console.log('路由参数:', id, taskId, type) - this.auditingParams.taskId = taskId - // 如果有type参数,则设置pagesType - if (type !== undefined) { - this.pagesType = type - }else{ - this.getNodeAuditStatus() - } - // this.currentNodeId = nodeId - await this.getLeaseTaskDetailFun(id, taskId) - } - this.userId = sessionStorage.getItem('userId') + // 判断当前路由页面是否有查询参数 + if (this.$route.query) { + const { id, taskId, type } = this.$route.query + console.log('路由参数:', id, taskId, type) + this.auditingParams.taskId = taskId + // 如果有type参数,则设置pagesType + if (type !== undefined) { + this.pagesType = type + }else{ + this.getNodeAuditStatus() + } + // this.currentNodeId = nodeId + await this.getLeaseTaskDetailFun(id, taskId) + } + this.userId = sessionStorage.getItem('userId') }, methods: { - // async getConfigApi(){ - // getConfig().then(response => { - // // console.log(response) - // localStorage.setItem('systemConfig', JSON.stringify(response.data || {})) - // sessionStorage.setItem('systemConfig', JSON.stringify(response.data || {})) - // }) - // .catch(error => { - // console.error('Failed to fetch config:', error); - // }); - // }, - - async getNodeAuditStatus(){ const res = await getNodeAuditStatusAPI({taskId:this.auditingParams.taskId}) if(res.data){ - this.pagesType = res.data.auditStatus + if (res.data.auditStatus == 0) { + this.pagesType = 1; + } else if (res.data.auditStatus == 1) { + this.pagesType = 2; + }else{ + this.pagesType = 1; + } }else{ - this.pagesType = 0 + this.pagesType = 1 } }, diff --git a/src/views/business-examine/receive-apply/index.vue b/src/views/business-examine/receive-apply/index.vue index b9a141be..e6ce3788 100644 --- a/src/views/business-examine/receive-apply/index.vue +++ b/src/views/business-examine/receive-apply/index.vue @@ -118,7 +118,7 @@ export default { pageNum: 1, pageSize: 10, keyWord: '', // 关键字 - taskStatus: '' // 审核状态 + taskStatus: '1' // 审核状态 }, // 审核状态 statusOptions: [ @@ -143,6 +143,12 @@ export default { } }, async created() { + const end = new Date() + let start = new Date() + start.setMonth(start.getMonth() - 1) + this.timeRange = [this.format(start), this.format(end)] + + const origin = window.location.href console.log(origin.split('ticket')[1], 'origin') const token = getToken() @@ -199,13 +205,22 @@ export default { } }, methods: { + format(date) { + const y = date.getFullYear() + const m = String(date.getMonth() + 1).padStart(2, '0') + const day = String(date.getDate()).padStart(2, '0') + return `${y}-${m}-${day}` + }, // 查询 handleQuery() { this.getList() }, // 重置 handleReset() { - this.timeRange = [] + const end = new Date() + let start = new Date() + start.setMonth(start.getMonth() - 1) + this.timeRange = [this.format(start), this.format(end)] this.queryParams.pageNum = 1 this.queryParams.pageSize = 10 this.$refs.queryForm.resetFields()