From c2d3a6e9aaedcda8efbba97773749be5275f3ff3 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期六, 02 十二月 2023 10:09:30 +0800 Subject: [PATCH] # --- pages/business/plan/planDetails.vue | 151 +++++++++--- pages.json | 6 pages/business/plan/plan.vue | 66 +++++ pages/business/saleManage/saleManage.vue | 2 pages/login/login2.vue | 392 +++++++++++++++++++++++++++++++++++ pages/business/pricing/priQuote.vue | 2 pages/business/pricing/priOnline.vue | 3 pages/business/goBusiness/reimburseOnline.vue | 2 pages/business/pricing/contract.vue | 2 pages/business/goBusiness/businessTripOther.vue | 2 pages/business/cstmr/csmtr.vue | 2 pages/business/cstmrInfo/cstmrInfo.vue | 2 pages/business/goBusiness/goBusiness.vue | 2 13 files changed, 576 insertions(+), 58 deletions(-) diff --git a/pages.json b/pages.json index 3d0c9a2..450c4a1 100644 --- a/pages.json +++ b/pages.json @@ -1,6 +1,12 @@ { "pages": [ //pages鏁扮粍涓涓�椤硅〃绀哄簲鐢ㄥ惎鍔ㄩ〉锛屽弬鑰冿細https://uniapp.dcloud.io/collocation/pages { + "path": "pages/login/login2", + "style": { + "navigationBarTitleText": "鐧诲綍2" + } + }, + { "path": "pages/login/login", "style": { "navigationBarTitleText": "鐧诲綍" diff --git a/pages/business/cstmr/csmtr.vue b/pages/business/cstmr/csmtr.vue index dd1d12e..4597685 100644 --- a/pages/business/cstmr/csmtr.vue +++ b/pages/business/cstmr/csmtr.vue @@ -61,7 +61,7 @@ user: { username: '', id: 0, - type: 'user_id' + type: '' }, userid: 0, reload: false, diff --git a/pages/business/cstmrInfo/cstmrInfo.vue b/pages/business/cstmrInfo/cstmrInfo.vue index fecd061..c580307 100644 --- a/pages/business/cstmrInfo/cstmrInfo.vue +++ b/pages/business/cstmrInfo/cstmrInfo.vue @@ -97,7 +97,7 @@ user: { username: '', id: 0, - type: 'user_id' + type: '' }, falg: true, csmtrList: [], diff --git a/pages/business/goBusiness/businessTripOther.vue b/pages/business/goBusiness/businessTripOther.vue index a9878f3..0606f5b 100644 --- a/pages/business/goBusiness/businessTripOther.vue +++ b/pages/business/goBusiness/businessTripOther.vue @@ -53,7 +53,7 @@ user: { username: '', id: 0, - type: 'user_id' + type: '' }, falg: true, list:[], diff --git a/pages/business/goBusiness/goBusiness.vue b/pages/business/goBusiness/goBusiness.vue index d4077fa..125b9dd 100644 --- a/pages/business/goBusiness/goBusiness.vue +++ b/pages/business/goBusiness/goBusiness.vue @@ -54,7 +54,7 @@ user: { username: '', id: 0, - type: 'user_id' + type: '' }, falg: true, list: [{ diff --git a/pages/business/goBusiness/reimburseOnline.vue b/pages/business/goBusiness/reimburseOnline.vue index 31fdb56..ccbcd89 100644 --- a/pages/business/goBusiness/reimburseOnline.vue +++ b/pages/business/goBusiness/reimburseOnline.vue @@ -51,7 +51,7 @@ user: { username: '', id: 0, - type: 'user_id' + type: '' }, falg: true, list: [], diff --git a/pages/business/plan/plan.vue b/pages/business/plan/plan.vue index 573653a..0f066b8 100644 --- a/pages/business/plan/plan.vue +++ b/pages/business/plan/plan.vue @@ -101,6 +101,7 @@ <view class="fxbtn"> <uni-icons type="plusempty" color="#fff" @click="gotoggle()" ></uni-icons> </view> + <uni-load-more :status="status" :icon-size="16" :content-text="contentText" /> </view> </template> @@ -113,7 +114,7 @@ user: { username: '', id: 0, - type: 'user_id' + type: '' }, falg: true, csmtrList: [], @@ -157,7 +158,8 @@ name:'鍏朵粬', value: 7 }, - ] + ], + param: {curr:1,limit:4} } }, onLoad() { @@ -175,7 +177,7 @@ this.getDetail() } setTimeout(()=> { - this.getCsmtr1() + this.getList() },50) }, onReachBottom() { @@ -214,10 +216,60 @@ // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦� uni-popup 缁勪欢涓婄粦瀹� type灞炴�� this.$refs.popup.open(type) }, + getList() { + let that = this + that.csmtrList = [] + uni.showLoading() + if (this.user.type == 'user_id') { + that.param = {curr:1,limit:4,user_id: that.user.id} + } else if(this.user.type == 'dept_id') { + that.param = {curr:1,limit:4,dept_id: that.user.id} + } + uni.request({ + url: that.baseUrl + '/plan/page/auth', + header: {'token' : uni.getStorageSync('token'),}, + data: that.param, + method:'GET', + success(result) { + if (result.statusCode === 404) { + uni.showToast({title: '璇烽噸鏂扮櫥褰�', icon: "none", position: 'top'}) + return + } + var res = result.data + if (res.code === 200) { + let list = res.data.records + that.csmtrList = that.reload ? list : that.csmtrList.concat(list); + if (res.data.records.length == 0) { + that.status = 'noMore' + } + } else if (res.code === 403) { + uni.showToast({title: res.msg, icon: "none", position: 'top'}) + setTimeout(() => { + uni.reLaunch({ + url: '../../login/login' + }); + }, 1000); + } else { + uni.showToast({title: res.msg, icon: "none",position: 'top'}) + } + }, + fail(result) { + uni.showToast({title: '璇锋眰澶辫触'}) + setTimeout(() => { + uni.reLaunch({ + url: '../../login/login' + }); + }, 1000); + }, + complete() { + uni.hideLoading() + } + }) + }, getCsmtr1(e) { let that = this that.csmtrList = [] - uni.showLoading({}) + uni.showLoading() let param = {curr:1,limit:4,dept_id: 0,user_id: 67} if (this.user.type == 'user_id') { param = {curr:1,limit:4,user_id: that.user.id} @@ -226,6 +278,7 @@ } else { param = {curr:1,limit:4} } + param = {curr:1,limit:4} uni.request({ url: that.baseUrl + '/plan/page/auth', header: {'token' : uni.getStorageSync('token'),}, @@ -292,7 +345,10 @@ if (res.code === 200) { let list = res.data.records that.csmtrList = that.reload ? list : that.csmtrList.concat(list); - that.curr = that.curr + 1 + console.log(list); + if (list.length > 0) { + that.curr = that.curr + 1 + } if (res.data.records.length == 0) { that.status = 'noMore' } diff --git a/pages/business/plan/planDetails.vue b/pages/business/plan/planDetails.vue index 2a03161..63a50e9 100644 --- a/pages/business/plan/planDetails.vue +++ b/pages/business/plan/planDetails.vue @@ -63,25 +63,43 @@ <view> <!-- 杈撳叆妗嗙ず渚� --> <uni-popup ref="inputDialog" type="dialog"> - <uni-popup-dialog ref="inputClose" mode="input" title="娣诲姞璺熻繘浜�" value="瀵硅瘽妗嗛缃彁绀哄唴瀹�!" + <uni-popup-dialog ref="inputClose" mode="input" title="閫夋嫨瑙勫垝鍛�" placeholder="璇疯緭鍏ュ唴瀹�" @confirm="confirm"> - <uni-combox :candidates="addFollower.followers" placeholder="璇烽�夋嫨" - v-model="addFollower.follower" @input="autoLoad('follower',addFollower.follower)"></uni-combox> + <uni-combox :candidates="planners" placeholder="璇烽�夋嫨" + v-model="planner" @input="autoLoad('planner',planner)"></uni-combox> </uni-popup-dialog> </uni-popup> </view> <view class="foot"> - <button size="mini" type="primary" @click="edite(id)">淇敼</button> + <button v-show="((((detl.settle == 2 || detl.settle == 3) && detl.settleSize==4) || detl.settle == 1) && user.id == detl.director)" + size="mini" type="primary" @click="approval(id)">瀹℃壒</button> + <button v-show="(((detl.settle == 2 || detl.settle == 3)&& detl.settleSize==4) && user.id == detl.director)" + size="mini" type="primary" @click="approvalEnd(id)">鍥為��瀹℃壒</button> + <button v-show="(detl.settle == 1 && user.id == detl.userId)" + size="mini" type="primary" @click="edite(id)">淇敼</button> <!-- <button size="mini" type="warn" @click="del(id)">鍒犻櫎</button> --> </view> </view> </template> <script> + import user from '@/pages/api/user/user.js' export default { data() { return { + planner: '', + plannerId: '', + planners: [], + plannerList: [], + nowUserId: '', // 褰撳墠鐧诲綍浜哄憳 user.userId + director: '', // 褰撳墠鑺傜偣瀹℃牳 dire + userId: '', // 褰撳墠浠诲姟涓氬姟鍛� userid + user: { + username: '', + id: 0, + type: '' + }, current: 1, id: 0, detl: { @@ -120,7 +138,7 @@ } }, onLoad(option) { - console.log(option); + this.current = 1 if (JSON.stringify(option) != "{}") { this.id = option.id this.init() @@ -128,13 +146,26 @@ let _this = this const eventChannel = this.getOpenerEventChannel(); eventChannel.on('saleManage', function(data) { - console.log(data); _this.id = data.data _this.init() }) } }, + onShow() { + this.getDetail() + }, methods: { + // 鑾峰彇鐢ㄦ埛淇℃伅 + async getDetail() { + let res = await user.getDetail() + if (res.code === 200) { + this.user.username = res.data.username + this.user.id = res.data.id + } else if (res.code === 403) { + this.backLogin(res) + } + }, + // 鍒濆鍖� init() { let that = this that.info = [] @@ -228,6 +259,7 @@ } }) }, + // 鍒犻櫎 del(e) { let that = this e = Number(e) @@ -256,52 +288,26 @@ addPerson() { this.$refs.inputDialog.open() }, - // 纭閫夋嫨宸ヤ綔浜� - confirm() { - let that = this - var followerId - var followerList = that.addFollower.followerList - for (var i = 0;i < followerList.length; i++) { - if (followerList[i].name == this.addFollower.follower) { - followerId =followerList[i].value - } - } - uni.request({ - url: that.baseUrl + '/detl/followers/add/json', - header:{'token':uni.getStorageSync('token'), - // 'content-type':'application/x-www-form-urlencoded', - }, - data: { - cstmrId: that.cstmrId, - followerIds:followerId}, - method: 'POST', - success(result) { - var res = result.data - that.getFollowers() - } - }) - this.addFollower.follower = '' - }, // 宸ヤ綔浜哄垪琛� autoLoad(type,condition) { let that = this - that.addFollower.followers = [] - that.addFollower.followerList = [] uni.request({ - url: that.baseUrl + '/user/all/get/kv', - header:{'token':uni.getStorageSync('token')}, - data: {condition:condition}, + url: that.baseUrl + '/plan/planner/list/auth', + header:{ + 'token':uni.getStorageSync('token'), + 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8' + }, + sslVerify: false, + data: {planId:condition}, method: 'POST', success(result) { var res = result.data if (res.code === 200) { - var element; - if (type == 'follower') { - for(element of res.data) { - that.addFollower.followers.push(element.name) - that.addFollower.followerList.push(element) + if (res.data) { + for (let k of res.data) { + that.planners.push(k.name) + that.plannerList.push(k) } - return } } } @@ -337,6 +343,65 @@ url: url }) }, + // 瀹℃壒 + approval() { + let _this = this + this.$refs.inputDialog.open() + this.autoLoad("type",this.detl.id) + }, + // 瑙勫垝鍛樺鎵� + confirm() { + for (let element of this.plannerList) { + if(element.value == this.planner) { + this.plannerId = element.value + } + } + let _this = this + uni.request({ + url: `${_this.baseUrl}/plan/approval/auth`, + header: { + 'token':uni.getStorageSync('token'), + 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8' + }, + sslVerify: false, + data: { + planId: _this.detl.id, + plannerId: _this.plannerId + }, + method: 'POST', + success(res) { + res = res.data + uni.showToast({title: res.msg, icon: "none", position: 'top'}) + uni.navigateBack() + } + }) + }, + approvalEnd() { + let _this = this + uni.request({ + url: `${_this.baseUrl}/plan/approvalEnd/auth`, + header: { + 'token':uni.getStorageSync('token'), + 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8' + }, + sslVerify: false, + data: { planId: _this.detl.id }, + method: 'POST', + success(res) { + res = res.data + uni.showToast({title: res.msg, icon: "none", position: 'top'}) + uni.navigateBack() + } + }) + }, + backLogin(res) { + uni.showToast({title: res.msg, icon: "none", position: 'top'}) + setTimeout(() => { + uni.reLaunch({ + url: '../../login/login' + }); + }, 1000); + }, } } </script> diff --git a/pages/business/pricing/contract.vue b/pages/business/pricing/contract.vue index 37ade19..e1116e5 100644 --- a/pages/business/pricing/contract.vue +++ b/pages/business/pricing/contract.vue @@ -48,7 +48,7 @@ user: { username: '', id: 0, - type: 'user_id' + type: '' }, falg: true, list: [], diff --git a/pages/business/pricing/priOnline.vue b/pages/business/pricing/priOnline.vue index 02b7fb6..e05ce6e 100644 --- a/pages/business/pricing/priOnline.vue +++ b/pages/business/pricing/priOnline.vue @@ -50,7 +50,7 @@ user: { username: '', id: 0, - type: 'user_id' + type: '' }, falg: true, list: [], @@ -62,7 +62,6 @@ onShow() { let that = this uni.$on('isRefresh',function(data){ - // console.log(data); that.user.username = data.title that.user.id = data.id that.user.type = data.key diff --git a/pages/business/pricing/priQuote.vue b/pages/business/pricing/priQuote.vue index 14efadb..02d263b 100644 --- a/pages/business/pricing/priQuote.vue +++ b/pages/business/pricing/priQuote.vue @@ -50,7 +50,7 @@ user: { username: '', id: 0, - type: 'user_id' + type: '' }, falg: true, list: [], diff --git a/pages/business/saleManage/saleManage.vue b/pages/business/saleManage/saleManage.vue index 4587ee7..d821256 100644 --- a/pages/business/saleManage/saleManage.vue +++ b/pages/business/saleManage/saleManage.vue @@ -92,7 +92,7 @@ user: { username: '', id: 0, - type: 'user_id' + type: '' }, falg: true, csmtrList: [], diff --git a/pages/login/login2.vue b/pages/login/login2.vue new file mode 100644 index 0000000..1d24776 --- /dev/null +++ b/pages/login/login2.vue @@ -0,0 +1,392 @@ +<template> + <view class="container"> + <image class="logo" src="/static/image/logo.png"></image> + <!-- 鐧诲綍淇℃伅 --> + <view class="user-info"> + <view class="user-info-item shadow-warp"> + <view class="icons"> + <uni-icons type="person" size="20"></uni-icons> + </view> + <text>璐﹀彿锛�</text> + <input type="text" placeholder="璇疯緭鍏ヨ处鍙�!" v-model="user.userName" + placeholder-style="font-size:14px;color:#ccc;"> + </view> + <view class="user-info-item shadow-warp"> + <view class="icons"> + <uni-icons type="locked" size="20"></uni-icons> + </view> + <text>瀵嗙爜锛�</text> + <input :password="!showPassword" v-model="user.password" placeholder="璇疯緭鍏ュ瘑鐮�!" + placeholder-style="font-size:14px;color:#ccc;"> + <view class="showPassword" v-if="showPassword" @click="changePassword"> + <uni-icons type="eye" size="20"></uni-icons> + </view> + <view class="showPassword" v-if="!showPassword" @click="changePassword"> + <uni-icons type="eye-slash" size="20"></uni-icons> + </view> + </view> + </view> + <!-- 鐧诲綍鎸夐挳 --> + <view class="loging"> + <button class="button" @click="onLogin()" :loading="load.loading">{{load.btnText}}</button> + </view> + + <view> + <!-- 鎻愮ず绐楃ず渚� --> + <uni-popup ref="upVersion" type="dialog"> + <uni-popup-dialog :type="msgType" title="閫氱煡" :content="dialogContent" @confirm="dialogConfirm" + @close="dialogClose"></uni-popup-dialog> + </uni-popup> + </view> + + <!-- #ifdef APP-PLUS --> + <view class="version"> + 褰撳墠鐗堟湰: {{version}} + </view> + <!-- #endif --> + </view> +</template> + +<script> + import md5 from '../../common/md5.js' + export default { + data() { + return { + version: '', + showPassword: false, + user: { + userName: '', + password: '', + }, + load: { + loading: false, + btnText: '鐧诲綍' + }, + msgType: 'success', + filename: '', + dialogContent: '' + } + }, + onLoad: function() { + this.user.userName = uni.getStorageSync('userName') + this.user.password = uni.getStorageSync('password') + // #ifdef APP-PLUS + var that = this + plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) { + that.version = wgtinfo.version + }); + // #endif + }, + onShow() { + this.getVersion() + }, + methods: { + changePassword: function() { + this.showPassword = !this.showPassword; + }, + //妫�娴嬪綋鍓嶅钩鍙帮紝濡傛灉鏄畨鍗撳垯鍚姩瀹夊崜鏇存柊 + getVersion() { + let that = this; + uni.getSystemInfo({ + success: (res) => { + if (res.platform == "android") { + that.AndroidCheckUpdate(); + } + } + }) + }, + // 鑾峰彇褰撳墠鐗堟湰鍙� + AndroidCheckUpdate() { + let that = this; + plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => { + that.version = wgtinfo.version //瀹㈡埛绔増鏈彿 + }) + setTimeout(()=>{ + that.getUpdateVersion() + },100) + }, + // 鏍¢獙鐗堟湰 + getUpdateVersion() { + let that = this + let type = 0 + if (that.baseUrl == 'http://undefined:undefined/undefined') { + return + } + + let url = that.baseUrl + '/appVersion/checkUpdate/' + that.version + '/' + type + uni.request({ + url: url, + method: 'GET', + success(res) { + console.log(res); + var res = res.data + if (res.data) { + that.filename = res.data.path + that.dialogContent = '鍙戠幇鏂扮増鏈�:' + res.data.version + ', 鏄惁绔嬪嵆鏇存柊' + that.$refs.upVersion.open() + } else { + uni.showToast({ + title: res.msg, + icon: "none", + position: 'top' + }) + } + + } + }) + }, + dialogConfirm() { + this.$refs.upVersion.close() + this.downWgt() + }, + dialogClose() { + this.$refs.upVersion.close() + }, + downWgt() { + let that = this; + const downloadUrl = that.baseUrl + "/appVersion/downloadApp/" + that.filename + uni.showLoading({ + title: '鏇存柊涓�︹��' + }) + const downloadTask = uni.downloadFile({ //鎵ц涓嬭浇 + url: downloadUrl, //涓嬭浇鍦板潃 + timeout: 1000 * 30, //30绉掕秴鏃舵椂闂� + success: downloadResult => { //涓嬭浇鎴愬姛 + console.log(downloadResult); + that.showdownLine = false + uni.hideLoading(); + if (downloadResult.statusCode == 200) { + uni.showModal({ + title: '', + content: '鏇存柊鎴愬姛锛岀‘瀹氱幇鍦ㄩ噸鍚悧锛�', + confirmText: '閲嶅惎', + confirmColor: '#EE8F57', + success: function(res) { + if (res.confirm == true) { + plus.runtime.install( //瀹夎 + downloadResult.tempFilePath, { + force: true + }, + function(res) { + utils.showToast('鏇存柊鎴愬姛锛岄噸鍚腑'); + plus.runtime.restart(); + } + ); + } + } + }); + } else { + uni.hideLoading(); + that.showdownLine = false + uni.showToast({ + title:'璇峰厛涓婁紶瀹夎鍖�', + icon: 'error' + }) + } + }, + fail: err => { + uni.hideLoading(); + that.showdownLine = false + that.$u.toast(downloadResult.errMsg) + }, + complete: com => { + + console.log(com) + } + }); + + // 涓嬭浇杩涘害 + downloadTask.onProgressUpdate(res => { + that.downloadNum = res.progress + console.log('涓嬭浇杩涘害' + that.downloadNum); + }); + }, + onLogin() { + let that = this + uni.request({ + url: that.baseUrl + '/login.action', + fail(result) { + uni.showToast({ + icon: 'error', + title: '璇锋眰澶辫触' + }) + }, + data: { + username: that.user.userName, + password: md5.hex_md5(that.user.password) + }, + header: { + "content-type": "application/json" + }, + success(result) { + if (result.statusCode === 404) { + uni.showToast({ + title: '鐧诲綍澶辫触', + icon: "error" + }) + return + } + let res = result.data + if (res.code === 200) { + that.load.loading = true; + that.load.btnText = '鐧诲綍涓�'; + uni.setStorageSync('token', res.data.token); + uni.setStorageSync('userName', that.user.userName); + uni.setStorageSync('password', that.user.password); + setTimeout(() => { + uni.showToast({ + title: '鐧诲綍鎴愬姛' + }) + setTimeout(() => { + uni.reLaunch({ + url: '../index/index' + }); + }, 300) + }, 700) + } else { + uni.showToast({ + title: res.msg + }) + } + }, + + + }) + }, + } + } +</script> + +<style> + .container { + display: flex; + flex-direction: column; // 琛ㄧず鍨傜洿鏂瑰悜锛岀敱涓婂埌涓� + width: 100%; + min-height: 93.4vh; + } + + .logo { + width: 300px; + height: 163px; + margin-top: 100rpx; + margin-left: auto; + margin-right: auto; + margin-bottom: 50rpx; + } + + .user-info { + display: flex; + align-items: center; + flex-direction: column; + width: 100%; + height: 400rpx; + font-size: 14px; + letter-spacing: 1px; + } + + .user-info-item { + display: flex; + width: 650rpx; + height: 100rpx; + line-height: 100rpx; + align-items: center; + background-color: #fff; + margin-bottom: 30rpx; + font-size: 28rpx; + font-weight: 500; + } + + .user-info-item>input { + width: 400rpx; + color: #606266; + font-weight: 500; + caret-color: #606266; // 鍏夋爣棰滆壊 + } + + .icons { + margin-left: 20rpx; + margin-right: 18rpx; + } + + .showPassword { + position: absolute; + right: 10rpx; + } + + .shadow-warp { + position: relative; + box-shadow: 0 0 10upx rgba(0, 0, 0, 0.1); + } + + .shadow-warp:before, + .shadow-warp:after { + position: absolute; + content: ""; + top: 20upx; + bottom: 30upx; + left: 20upx; + width: 50%; + box-shadow: 0 30upx 20upx rgba(0, 0, 0, 0.2); + transform: rotate(-3deg); + z-index: -1; + } + + .shadow-warp:after { + right: 20upx; + left: auto; + transform: rotate(3deg); + } + + .loging { + position: fixed; + bottom: 100rpx; + left: 0; + right: 0; + margin-left: auto; + margin-right: auto; + } + + .button { + color: #fff; + background-color: #409EFF; + width: 150px; + height: 40px; + line-height: 40px; + } + + button::after { + border: initial; + } + + .button-hover { + color: #fff; + background-color: #6fc1ff; + } + + .version { + width: 100%; + position: fixed; + bottom: 30rpx; + left: 0; + right: 0; + margin-left: auto; + margin-right: auto; + text-align: center; + font-size: 10px; + color: #C0C4CC; + } + + .input { + display: block; + font-size: 14px; + } + + .uni-input { + height: 50rpx; + padding: 15rpx 25rpx; + line-height: 50rpx; + font-size: 28rpx; + background: #FFF; + flex: 1; + } +</style> -- Gitblit v1.9.1