From 0a92f972ab3042925568d0b9821107629e8af86c Mon Sep 17 00:00:00 2001 From: FrancisHu <2756004617@qq.com> Date: Tue, 18 Jun 2024 17:44:13 +0800 Subject: [PATCH] =?UTF-8?q?6.18=E5=AE=81=E5=A4=8F=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/exitExam/exitExam.vue | 85 ++++++++++++++++------------- pages/exitMaterial/exitMaterial.vue | 12 +++- pages/fixPwd/fixPwd.vue | 9 ++- pages/testExam/testExam.vue | 10 ++-- 4 files changed, 68 insertions(+), 48 deletions(-) diff --git a/pages/exitExam/exitExam.vue b/pages/exitExam/exitExam.vue index 4110a41..58ad0e1 100644 --- a/pages/exitExam/exitExam.vue +++ b/pages/exitExam/exitExam.vue @@ -319,50 +319,61 @@ import { basePath } from '../../public' }).catch(err => { console.log(err); }) + }, + initFetch () { + let that = this + // 获取退料审批清单 + that.$api.exitExam.exitExamList({ + companyId: uni.getStorageSync('userInfo').sysUser.companyId + // companyId: 1 + }).then(res => { + console.log(res); + if (res.data.code == 200) { + if (res.data.data.length == 0) { + uni.showToast({ + icon: 'none', + title: '未查询到相关数据!' + }) + } else { + that.fetchMaterialList = res.data.data + console.log(that.fetchMaterialList); + } + } else if (res.data.code == 500) { + uni.showToast({ + icon: 'none', + title: '登录状态已过期,请重新登录!', + success: () => { + uni.removeStorageSync('token') + uni.removeStorageSync('userInfo') + uni.reLaunch({ + url: '/pages/login/login' + }) + } + }) + } else { + uni.showToast({ + icon: 'none', + title: res.data.msg + }) + } + }).catch(err => { + console.log(err); + }) } }, onShow() { let that = this // that.roles = uni.getStorageSync('roles') console.log(that.roles, uni.getStorageSync('userInfo').sysUser.companyId); - if (that.roles.includes('admin')) that.roles = ['admin', 'jjfgs', 'tsfgs'] - // 获取退料审批清单 - that.$api.exitExam.exitExamList({ - companyId: uni.getStorageSync('userInfo').sysUser.companyId - // companyId: 1 - }).then(res => { - console.log(res); - if (res.data.code == 200) { - if (res.data.data.length == 0) { - uni.showToast({ - icon: 'none', - title: '未查询到相关数据!' - }) - } else { - that.fetchMaterialList = res.data.data - console.log(that.fetchMaterialList); - } - } else if (res.data.code == 500) { - uni.showToast({ - icon: 'none', - title: '登录状态已过期,请重新登录!', - success: () => { - uni.removeStorageSync('token') - uni.removeStorageSync('userInfo') - uni.reLaunch({ - url: '/pages/login/login' - }) - } - }) - } else { - uni.showToast({ - icon: 'none', - title: res.data.msg - }) + for (let i = 0; i < that.roles.length; i++) { + if (that.roles[i] == 'em01' || that.roles[i] == 'em02') { + that.roles[i] = 'jjfgs' + } else if (that.roles[i] == 'dm01' || that.roles[i] == 'dm02') { + that.roles[i] = 'tsfgs' } - }).catch(err => { - console.log(err); - }) + } + if (that.roles.includes('admin')) that.roles = ['admin', 'jjfgs', 'tsfgs'] + that.initFetch() } } diff --git a/pages/exitMaterial/exitMaterial.vue b/pages/exitMaterial/exitMaterial.vue index f14fed3..3e2018f 100644 --- a/pages/exitMaterial/exitMaterial.vue +++ b/pages/exitMaterial/exitMaterial.vue @@ -140,6 +140,7 @@ + @@ -223,7 +224,8 @@ import { basePath } from '../../public' remark: '' }, fetchedList: [], - ableRoleArr: ['admin', 'em04', 'me02', 'dm03'] + ableRoleArr: ['admin', 'em04', 'me02', 'dm03'], + showLoading: false } }, methods: { @@ -259,6 +261,7 @@ import { basePath } from '../../public' }, formSubmit () { let that = this + that.showLoading = true that.$refs.exitForm.validate().then(formData => { that.$refs.popup.close() // 判断单位id和工程id是否匹配 @@ -280,6 +283,7 @@ import { basePath } from '../../public' that.$api.exitMaterial.newExitList(that.newAdd).then(res => { console.log(res); if (res.data.code == 200) { + that.showLoading = false uni.showToast({ icon: 'none', title: '新增申请成功!', @@ -289,6 +293,12 @@ import { basePath } from '../../public' }) } }) + } else { + that.showLoading = false + uni.showToast({ + icon: 'none', + title: res.data.msg + }) } }).catch(err => { console.log(err); diff --git a/pages/fixPwd/fixPwd.vue b/pages/fixPwd/fixPwd.vue index a011845..7c63e23 100644 --- a/pages/fixPwd/fixPwd.vue +++ b/pages/fixPwd/fixPwd.vue @@ -64,19 +64,18 @@ } ] } - } + }, + strongPwdReg: /^\S*(?=\S{8,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*? ])\S*$/ } }, methods: { submitForm() { let that = this - let strongPwdReg = /^\S*(?=\S{8,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*? ])\S*$/ that.$refs.pwdForm.validate().then(formData => { - if (!strongPwdReg.test(formData.newPassword)) { + if (!that.strongPwdReg.test(formData.newPassword)) { uni.showToast({ icon: 'none', - title: '新密码格式有误!', - duration: 3000 + title: '新密码格式有误!' }) } else if (formData.newPassword != formData.confirmNewPassword) { uni.showToast({ diff --git a/pages/testExam/testExam.vue b/pages/testExam/testExam.vue index c6ab518..dba1a54 100644 --- a/pages/testExam/testExam.vue +++ b/pages/testExam/testExam.vue @@ -321,13 +321,13 @@ // 初始化查询报废审核清单 that.$api.testExam.testExamList().then(res => { console.log(res); - if (res.data.total != 0) { - for (let i = 0; i < res.data.rows.length; i++) { - if (res.data.rows[i].taskStatus == 46) { - res.data.rows[i].checked = false + if (res.data.data.total != 0) { + for (let i = 0; i < res.data.data.rows.length; i++) { + if (res.data.data.rows[i].taskStatus == 46) { + res.data.data.rows[i].checked = false } } - that.fetchMaterialList = res.data.rows + that.fetchMaterialList = res.data.data.rows } else { uni.showToast({ icon: 'none',