diff --git a/apis/http.js b/apis/http.js index ec01134..ee2b774 100644 --- a/apis/http.js +++ b/apis/http.js @@ -3,25 +3,25 @@ class HttpConfig { baseUrl = "/api" // #endif // #ifdef APP-PLUS - // baseUrl = "http://112.29.103.165:21624" + baseUrl = "http://112.29.103.165:21624" // baseUrl = "http://192.168.0.14:21624" // baseUrl = "http://112.29.103.165:21626" // baseUrl = "http://172.20.10.3:8080" // baseUrl = "http://10.40.92.8:8080" // baseUrl = "http://10.40.92.52:28080" - // baseUrl = "http://10.40.92.81:8080" - // baseUrl = "https://z.csgmall.com.cn/gl" - baseUrl = "http://10.40.92.141:28080" + // baseUrl = "http://10.40.92.78:28080" + // baseUrl = "https://z.csgmall.com.cn/gl" + // baseUrl = "http://10.40.92.141:28080" // #endif // 基地址 - /* authPath = `${this.baseUrl}/dev-api/auth` + authPath = `${this.baseUrl}/dev-api/auth` systemPath = `${this.baseUrl}/dev-api/system` basePath = `${this.baseUrl}/dev-api/base` - materialPath = `${this.baseUrl}/dev-api/material` */ - authPath = `${this.baseUrl}/auth` + materialPath = `${this.baseUrl}/dev-api/material` + /* authPath = `${this.baseUrl}/auth` systemPath = `${this.baseUrl}/system` basePath = `${this.baseUrl}/base` - materialPath = `${this.baseUrl}/material` + materialPath = `${this.baseUrl}/material` */ // 短链 serviceUrl = { login: { diff --git a/manifest.json b/manifest.json index cfdd97e..06e9778 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "智慧仓储", "appid" : "__UNI__9D122E1", "description" : "", - "versionName" : "1.0.7", - "versionCode" : 107, + "versionName" : "1.0.8", + "versionCode" : 108, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { diff --git a/pages/fetchExam/fetchExam.vue b/pages/fetchExam/fetchExam.vue index 731b511..9357edf 100644 --- a/pages/fetchExam/fetchExam.vue +++ b/pages/fetchExam/fetchExam.vue @@ -72,17 +72,17 @@ 施管审核 - 安监审核 - + --> @@ -90,7 +90,7 @@ @@ -316,31 +316,54 @@ import { basePath } from '../../public' } } } - this.examList = { - taskId: that.modalList.taskId, - taskStatus: that.modalList.taskStatus + 1, - leaseApplyInfoList: that.modalList.leaseApplyInfoList - } - if (that.roles.includes('fgs')) { - for (let k = 0; k < that.examList.leaseApplyInfoList.length; k++) { - that.examList.leaseApplyInfoList[k].examineStatusId = 30 + if (that.modalList.taskStatus == 30) { + if (that.modalList.leaseApplyInfoList[0].leaseApplyDetails[0].companyId == 101) { + this.examList = { + taskId: that.modalList.taskId, + taskStatus: that.modalList.taskStatus + 1, + leaseApplyInfoList: that.modalList.leaseApplyInfoList + } + } else if (that.modalList.leaseApplyInfoList[0].leaseApplyDetails[0].companyId == 102) { + this.examList = { + taskId: that.modalList.taskId, + taskStatus: that.modalList.taskStatus + 2, + leaseApplyInfoList: that.modalList.leaseApplyInfoList + } } - } else if (that.roles.includes('sgb')) { + } else { + this.examList = { + taskId: that.modalList.taskId, + taskStatus: that.modalList.taskStatus + 1, + leaseApplyInfoList: that.modalList.leaseApplyInfoList + } + } + if (that.roles.includes('fgs') && that.modalList.taskStatus == 30) { + for (let k = 0; k < that.examList.leaseApplyInfoList.length; k++) { + // console.log(that.examList.leaseApplyInfoList[0].leaseApplyDetails[0].companyId); + if (that.examList.leaseApplyInfoList[0].leaseApplyDetails[0].companyId == 101) { + that.examList.leaseApplyInfoList[k].examineStatusId = 30 + that.examList.leaseApplyInfoList[k].status = 9 + } else if (that.examList.leaseApplyInfoList[0].leaseApplyDetails[0].companyId == 102) { + that.examList.leaseApplyInfoList[k].examineStatusId = 31 + that.examList.leaseApplyInfoList[k].status = 9 + } + } + } else if (that.roles.includes('sgb') && that.modalList.taskStatus == 31) { for (let k = 0; k < that.examList.leaseApplyInfoList.length; k++) { that.examList.leaseApplyInfoList[k].status = 5 that.examList.leaseApplyInfoList[k].examineStatusId = 31 } - } else if (that.roles.includes('ajb')) { + } else if (that.roles.includes('ajb') && that.modalList.taskStatus == 31) { for (let k = 0; k < that.examList.leaseApplyInfoList.length; k++) { that.examList.leaseApplyInfoList[k].status = 7 that.examList.leaseApplyInfoList[k].examineStatusId = 31 } - } else if (that.roles.includes('jjfgs')) { + } else if (that.roles.includes('jjfgs') && that.modalList.taskStatus == 32) { for (let k = 0; k < that.examList.leaseApplyInfoList.length; k++) { that.examList.leaseApplyInfoList[k].status = 1 that.examList.leaseApplyInfoList[k].examineStatusId = 32 } - } else if (that.roles.includes('tsfgs')) { + } else if (that.roles.includes('tsfgs') && that.modalList.taskStatus == 32) { for (let k = 0; k < that.examList.leaseApplyInfoList.length; k++) { that.examList.leaseApplyInfoList[k].status = 3 that.examList.leaseApplyInfoList[k].examineStatusId = 32 @@ -679,13 +702,22 @@ import { basePath } from '../../public' }, onShow() { let that = this + console.log(uni.getStorageSync('userInfo')); console.log(that.roles); - that.roles.forEach(item => { + 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' + } + } + /* that.roles.forEach(item => { console.log(item); if (item == 'em01' || item == 'em02') item = 'jjfgs' if (item == 'dm01' || item == 'dm02') item = 'tsfgs' - }) - if (that.roles.includes('admin')) that.roles = ['admin', 'fgs', 'sgb', 'ajb', 'jjfgs', 'tsfgs'] + }) */ + if (that.roles.includes('admin')) that.roles = ['fgs', 'sgb', 'ajb', 'jjfgs', 'tsfgs', 'admin'] + console.log(that.roles); that.initFetch() // that.getRoles() } diff --git a/pages/fetchMaterialOutStore/fetchMaterialOutStore.vue b/pages/fetchMaterialOutStore/fetchMaterialOutStore.vue index df80576..26f2c6c 100644 --- a/pages/fetchMaterialOutStore/fetchMaterialOutStore.vue +++ b/pages/fetchMaterialOutStore/fetchMaterialOutStore.vue @@ -23,7 +23,7 @@ --> - {{ fetch.createBy.slice(0, 1) }} + {{ fetch.createBy == null ? '' : fetch.createBy.slice(0, 1) }}

{{ fetch.createBy }}

@@ -147,16 +147,33 @@ import { basePath } from '../../public' fetchMaterialList: [ ], - examList: [] + examList: [], + ableRoles: ['admin', 'jjfgs', 'dm05'] } }, methods: { seeDetail (taskId, taskStatus, id) { - // if (taskStatus == 33) { - uni.navigateTo({ - url: `/pages/fetchMaterialOutStoreDetail/fetchMaterialOutStoreDetail?taskId=${taskId}&taskStatus=${taskStatus}&id=${id}` + /* let that = this + let nowRole = uni.getStorageSync('roles') + let found = false + for (let role of nowRole) { + if (that.ableRoles.includes(role)) { + found = true; + break; + } + } + console.log(found); + if (!found) { + uni.showToast({ + icon: 'none', + title: '当前角色没有操作权限!' }) - // } + } else { + + } */ + uni.navigateTo({ + url: `/pages/fetchMaterialOutStoreDetail/fetchMaterialOutStoreDetail?taskId=${taskId}&taskStatus=${taskStatus}&id=${id}` + }) }, /* checkAll() { this.allChecked = !this.allChecked diff --git a/pages/fetchMaterialOutStoreDetail/fetchMaterialOutStoreDetail.vue b/pages/fetchMaterialOutStoreDetail/fetchMaterialOutStoreDetail.vue index c70ed26..b27c870 100644 --- a/pages/fetchMaterialOutStoreDetail/fetchMaterialOutStoreDetail.vue +++ b/pages/fetchMaterialOutStoreDetail/fetchMaterialOutStoreDetail.vue @@ -280,7 +280,7 @@ that.fetchList.push(res.data.data.rows[0].leaseApplyInfoList[i].leaseApplyDetails[k]) } } */ - that.fetchList = res.data.data.rows + that.fetchList = res.data.data console.log('获取详情 ===========================',that.fetchList); // that.fetchList[1].manageType = 1 } diff --git a/pages/fixPwd/fixPwd.vue b/pages/fixPwd/fixPwd.vue index 7818694..a011845 100644 --- a/pages/fixPwd/fixPwd.vue +++ b/pages/fixPwd/fixPwd.vue @@ -11,7 +11,7 @@ - + @@ -70,8 +70,15 @@ 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 (formData.newPassword != formData.confirmNewPassword) { + if (!strongPwdReg.test(formData.newPassword)) { + uni.showToast({ + icon: 'none', + title: '新密码格式有误!', + duration: 3000 + }) + } else if (formData.newPassword != formData.confirmNewPassword) { uni.showToast({ icon: 'none', title: '确认密码与新密码不一致!' diff --git a/pages/index/index.vue b/pages/index/index.vue index 41c1adf..b9540ec 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -82,7 +82,6 @@
{{ notice.createTime }}
- @@ -138,67 +137,7 @@ import { authPath, basePath, publicPath, systemPath } from '../../public'; }, onLoad() { - let that = this - let nowVer = '' - let serveVer = '' - let apkPath = '' - // 获取app版本号 - plus.runtime.getProperty(plus.runtime.appid, (info) => { - nowVer = info.version.replace(/\./g, '') - }) - // 获取服务端app版本号 - this.$api.update.fetchAppVer().then(res => { - console.log(res); - if (res.data.code == 200) { - serveVer = res.data.data[0].versionName.replace(/\./g, '') - apkPath = res.data.data[0].apkPath - // 比较版本大小 - setTimeout(() => { - console.log(nowVer, serveVer, apkPath); - if (nowVer < serveVer) { - uni.showModal({ - title: '版本升级', - content: '当前版本非最新版本,请前往升级!', - showCancel: false, - confirmText: '升级', - success: (res) => { - if (res.confirm) { - that.showLoading = true - uni.hideTabBar() - let downloadApk = uni.downloadFile({ - url: apkPath, - success: (download) => { - console.log(download); - if (download.statusCode == 200) { - plus.runtime.install(download.tempFilePath, { - force: true - }, (install) => { - that.showLoading = false - uni.showTabBar() - console.log(install); - }) - } else { - uni.showTabBar() - that.showLoading = false - uni.showToast({ - icon: 'none', - title: '下载异常,请稍后再试!' - }) - } - } - }) - downloadApk.onProgressUpdate(res => { - that.percent = res.progress - }) - } - } - }) - } - }, 500) - } - }).catch(err => { - console.log(err); - }) + }, onShow() { console.log(uni.getStorageSync('token')); diff --git a/pages/login/login.vue b/pages/login/login.vue index 694aed1..47d5b23 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -61,6 +61,7 @@ + @@ -70,6 +71,7 @@ export default { data() { return { showLoading: false, + showDownload: false, accountFormData: { username: '', password: '' @@ -118,7 +120,8 @@ export default { } ] } - } + }, + percent: '' } }, methods: { @@ -205,7 +208,8 @@ export default { uni.setStorageSync('userInfo', res.data.data.login_user) uni.setStorageSync('token', res.data.data.access_token) uni.setStorageSync('roles', res.data.data.login_user.roles) - uni.setStorageSync('deptId', res.data.data.login_user.sysUser.dept.deptId) + uni.setStorageSync('pwd', formData.password) + // uni.setStorageSync('deptId', res.data.data.login_user.sysUser.dept.deptId) uni.showToast({ icon: 'none', title: '登录成功!', @@ -230,6 +234,74 @@ export default { }) }) } + }, + onShow() { + if (uni.getStorageSync('pwd')) { + this.accountFormData.password = uni.getStorageSync('pwd') + } + }, + onLoad() { + let that = this + let nowVer = '' + let serveVer = '' + let apkPath = '' + // 获取app版本号 + plus.runtime.getProperty(plus.runtime.appid, (info) => { + nowVer = info.version.replace(/\./g, '') + }) + // 获取服务端app版本号 + this.$api.update.fetchAppVer().then(res => { + console.log(res); + if (res.data.code == 200) { + serveVer = res.data.data[0].versionName.replace(/\./g, '') + apkPath = res.data.data[0].apkPath + // 比较版本大小 + setTimeout(() => { + console.log(nowVer, serveVer, apkPath); + if (nowVer < serveVer) { + uni.showModal({ + title: '版本升级', + content: '当前版本非最新版本,请前往升级!', + showCancel: false, + confirmText: '升级', + success: (res) => { + if (res.confirm) { + that.showDownload = true + uni.hideTabBar() + let downloadApk = uni.downloadFile({ + url: apkPath, + success: (download) => { + console.log(download); + if (download.statusCode == 200) { + plus.runtime.install(download.tempFilePath, { + force: true + }, (install) => { + that.showDownload = false + uni.showTabBar() + console.log(install); + }) + } else { + uni.showTabBar() + that.showDownload = false + uni.showToast({ + icon: 'none', + title: '下载异常,请稍后再试!' + }) + } + } + }) + downloadApk.onProgressUpdate(res => { + that.percent = res.progress + }) + } + } + }) + } + }, 500) + } + }).catch(err => { + console.log(err); + }) } } diff --git a/pages/orderCart/orderCart.vue b/pages/orderCart/orderCart.vue index 2c199ea..94adf3f 100644 --- a/pages/orderCart/orderCart.vue +++ b/pages/orderCart/orderCart.vue @@ -51,7 +51,6 @@ @@ -126,7 +125,6 @@ import { basePath } from '../../public'; }, computed: { totalPrice() { - //总计金额 var str = 0; for (var i = 0; i < this.searchData.length; i++) { if (this.searchData[i].checked) { @@ -137,7 +135,6 @@ import { basePath } from '../../public'; return str; }, searchData: function() { - //模糊查询 if (!this.inputs) { return this.list; } @@ -147,7 +144,7 @@ import { basePath } from '../../public'; }, }, methods: { - add(item) { //加加 + add(item) { let that = this let num = item.bookNum item.bookNum = num + 1 @@ -267,12 +264,24 @@ import { basePath } from '../../public'; async formSubmit () { let that = this - let nowRole = uni.getStorageSync('userInfo').roles.join(',') - await this.getgreementId() - if(this.deptFormData.deptName = ''){ - return; + let nowRole = uni.getStorageSync('roles') + let found = false + /* that.ableUseArr.forEach(item => { + if (nowRole.includes(item)) found = true + }) */ + for (let role of nowRole) { + console.log(role); + if (that.ableUseArr.includes(role)) { + found = true; + break; + } } - if (!that.ableUseArr.includes(nowRole)) { + console.log(found); + await this.getgreementId() + /* if(this.deptFormData.deptName = ''){ + return; + } */ + if (!found) { uni.showToast({ icon: 'none', title: '当前角色没有操作权限!' @@ -420,10 +429,10 @@ import { basePath } from '../../public'; }) } */ // 初始化查询全部部门 - console.log(uni.getStorageSync('userInfo').roles.join(',')) + console.log(uni.getStorageSync('roles')) that.$api.fetchMaterial.getDeptList().then(res => { if (res.data.code == 200) { - that.deptRange = res.data.data.map((item) => { + that.deptRange = res.data.data.map(item => { return { text: item['name'], value: item['id']