Browse Source

2024-5-16

dzl 6 tháng trước cách đây
mục cha
commit
5aee7cab9f

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "协同办公",
     "appid" : "__UNI__EEB5AF5",
     "description" : "",
-    "versionName" : "1.7.7",
-    "versionCode" : 177,
+    "versionName" : "1.8.1",
+    "versionCode" : 181,
     "transformPx" : false,
     "app-plus" : {
         /* 5+App特有相关 */

+ 7 - 1
package-lock.json

@@ -5,13 +5,19 @@
   "packages": {
     "": {
       "dependencies": {
-        "js-base64": "^3.7.7"
+        "js-base64": "^3.7.7",
+        "jsencrypt": "^3.3.2"
       }
     },
     "node_modules/js-base64": {
       "version": "3.7.7",
       "resolved": "https://registry.npmmirror.com/js-base64/-/js-base64-3.7.7.tgz",
       "integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw=="
+    },
+    "node_modules/jsencrypt": {
+      "version": "3.3.2",
+      "resolved": "https://registry.npmmirror.com/jsencrypt/-/jsencrypt-3.3.2.tgz",
+      "integrity": "sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A=="
     }
   }
 }

+ 2 - 1
package.json

@@ -1,5 +1,6 @@
 {
   "dependencies": {
-    "js-base64": "^3.7.7"
+    "js-base64": "^3.7.7",
+    "jsencrypt": "^3.3.2"
   }
 }

+ 7 - 1
pages/dailyWork/dailyWork.vue

@@ -165,8 +165,10 @@
 				this.morelist.push({name:'中层出差申请'})
 			}else if(options.fkFlow == '007'){
 				this.morelist.push({name:'外出授课申请'})
-			}else{
+			}else if(options.fkFlow == '009'){
 				this.morelist.push({name:'请(休)假申请'})
+			}else if(options.fkFlow == '015'){
+				this.morelist.push({name:'用车申请'})
 			}
 		},
 		onNavigationBarButtonTap(e) {
@@ -377,6 +379,10 @@
 					uni.navigateTo({
 						url:"/pages/shenqing/shenqing?title=请(休)假申请&fkFlow="+this.db.fkFlow
 					})
+				}else if(this.db.fkFlow == '015'){
+					uni.navigateTo({
+						url:"/pages/shenqing/shenqing?title=用车申请&fkFlow="+this.db.fkFlow
+					})
 				}
 				
 			}

+ 25 - 12
pages/login/login.vue

@@ -47,6 +47,7 @@
 </template>
 
 <script>
+	import JSEncrypt from 'jsencrypt'
 	export default {
 		data() {
 			return {
@@ -81,6 +82,14 @@
 			}
 		},
 		methods: {
+			//加密
+			encrypt(txt, publicKey) {
+				const encryptor = new JSEncrypt()
+				encryptor.setPublicKey(publicKey) // 设置公钥
+				return encryptor.encrypt(txt) // 对数据
+			},
+			
+			//获取密钥
 			//登陆按钮
 			logOn() {
 				let that = this
@@ -92,20 +101,24 @@
 						title: "登录中...",
 						mask: true
 					})
-					uni.$u.http.post('/app/login', that.model).then(qwe => {
-						// console.log(qwe)
-						getApp().globalData.token = qwe.token
-						uni.hideLoading()
-						uni.setStorageSync('token', qwe.token)
-						uni.setStorageSync('jtoken', qwe.jtoken)
-						that.getUserInfo()
-					}).catch(error => {
-						uni.hideLoading()
-						uni.showToast({
-							title:error.msg,
-							icon:'none'
+					uni.$u.http.get('/publicKey').then(res=>{
+						let password = this.encrypt(that.model.password, res.publicKey)
+						uni.$u.http.post('/app/login', {username:that.model.username,password:password}).then(qwe => {
+							// console.log(qwe)
+							getApp().globalData.token = qwe.token
+							uni.hideLoading()
+							uni.setStorageSync('token', qwe.token)
+							uni.setStorageSync('jtoken', qwe.jtoken)
+							that.getUserInfo()
+						}).catch(error => {
+							uni.hideLoading()
+							uni.showToast({
+								title:error.msg,
+								icon:'none'
+							})
 						})
 					})
+					
 
 				}).catch(errors => {
 

+ 4 - 2
pages/office/office.vue

@@ -24,7 +24,7 @@
 			})
 			currentWebview = this.$scope.$getAppWebview() //获取当前页面的webview对象
 			currentWebview.onLoad = this.loadSuccess()
-			this.filePath =`http://121.28.24.104:13898/app/kkfile/onlinePreview?url=${encodeURIComponent(Base64.encode(options.url))}` 
+			this.filePath =`http://121.28.24.104:13898/app/kkfile/onlinePreview?url=${encodeURIComponent(Base64.encode(options.url))}&officePreviewType=pdf` 
 			this.path = options.url
 		},
 		onNavigationBarButtonTap(e) {
@@ -54,7 +54,6 @@
 		    			})
 		    		}
 		    	  },fail:function(res){
-					  console.log(res)
 		    		  uni.hideLoading()
 		    		  uni.showToast({
 		    		  	title:"下载失败",
@@ -74,6 +73,9 @@
 		methods: {
 			loadSuccess(){
 				uni.hideLoading()
+			},
+			onWebViewLoaded(){
+				console.log('加载完成')
 			}
 		},
 		onReady() {

+ 161 - 6
pages/shenqing/shenqing.vue

@@ -1,8 +1,7 @@
 <template>
 	<view style="background-color: #fff;" v-if="content != null">
 		<view style="height: 100%;overflow: auto;">
-			<u--form labelPosition="left" labelAlign="center" :model="content" ref="uForm" :rules="rules"
-				errorType="toast" :labelStyle="{fontSize:'32rpx'}" labelWidth="120">
+			<u--form labelPosition="left" labelAlign="center" :model="content" ref="uForm" :rules="rules" :labelStyle="{fontSize:'32rpx'}" labelWidth="120">
 				<view v-if="fkFlow == '006'">
 					<u-form-item label="出差处室:" borderBottom prop="outWorkDept">
 						<u--input v-model="content.outWorkDept" border="none" readonly></u--input>
@@ -91,6 +90,40 @@
 						</view>
 					</u-form-item>
 				</view>
+				<view v-if="fkFlow == '015'">
+					<u-form-item label="申请人:" borderBottom ref="item1">
+						<u--input v-model="content.createBy" border="none" readonly></u--input>
+					</u-form-item>
+					<u-form-item label="联系电话:" borderBottom prop="phone" ref="item1">
+						<u--input v-model="content.phone" placeholder="请输入联系电话" border="none"></u--input>
+					</u-form-item>
+					<u-form-item label="用车日期:" borderBottom prop="startUseTime" @click="show = true">
+						<view :style="{color:content.startUseTime==null?'rgb(192, 196, 204)':''}">
+							{{content.startUseTime == null?'请选择起止日期':content.startUseTime+' 至 '+content.endUseTime}}
+						</view>
+					</u-form-item>
+					<u-form-item label="用车天数:" borderBottom ref="item1">
+						<u--input v-model="content.dayNum" border="none" readonly
+							placeholder="请填写用车天数"></u--input>
+					</u-form-item>
+					<u-form-item label="乘车人数:" borderBottom prop="carNum" ref="item1">
+						<u--input v-model="content.carNum" border="none" type="number"
+							placeholder="请填写乘车人数"></u--input>
+					</u-form-item>
+					<u-form-item label="目的地:" borderBottom prop="addres" ref="item1">
+						<u--textarea v-model="content.addres" placeholder="请填写目的地" border="none"
+							height="100"></u--textarea>
+					</u-form-item>
+					<u-form-item label="用途:" borderBottom prop="useMessage">
+						<u--textarea v-model="content.useMessage" placeholder="请填写用途" border="none"
+							height="100"></u--textarea>
+					</u-form-item>
+					<u-form-item label="接收人:" borderBottom prop="toEmpsName" v-if="fzr == true"  @click="peoShow = true">
+						<view :style="{color:content.toEmpsName==null?'rgb(192, 196, 204)':''}">
+							{{content.params.toEmps == null?'请选择接收人':content.toEmpsName}}
+						</view>
+					</u-form-item>
+				</view>
 				<view style="padding: 0 20rpx;">
 					<u-button type="primary" text="提交" @click="submit" style="margin-top: 40rpx;"></u-button>
 				</view>
@@ -128,7 +161,7 @@ import { handleTree } from '../../utils/wjw'
 				statusList: [],
 				//上个页面传过来的参数
 				parameter: null,
-				fkFlow: null, // 006 中层出差  007 外出授课备案 009请假
+				fkFlow: null, // 006 中层出差  007 外出授课备案 009请假 015用车
 				show: false, //日历
 				fzr:false,//判断是否是负责人
 				peoShow:false,
@@ -201,7 +234,6 @@ import { handleTree } from '../../utils/wjw'
 					},
 				},
 				rules3: {
-					leaveReason: null,
 					leaveTpye: {
 						type: 'string',
 						required: true,
@@ -227,6 +259,56 @@ import { handleTree } from '../../utils/wjw'
 						trigger: ['blur', 'change']
 					},
 				},
+				rules4:{
+					phone: [
+						{
+							required: true, 
+							message: '请输入手机号',
+							trigger: ['change','blur'],
+						},
+						{
+							// 自定义验证函数,见上说明
+							validator: (rule, value, callback) => {
+								// 上面有说,返回true表示校验通过,返回false表示不通过
+								// uni.$u.test.mobile()就是返回true或者false的
+								return uni.$u.test.mobile(value);
+							},
+							message: '手机号码不正确',
+							// 触发器可以同时用blur和change
+							trigger: ['change','blur'],
+						}
+					],
+					addres: {
+						type: 'string',
+						required: true,
+						message: '请填写目的地',
+						trigger: ['blur', 'change']
+					},
+					startUseTime: {
+						type: 'string',
+						required: true,
+						message: '请选择起止时间',
+						trigger: ['blur', 'change']
+					},
+					useMessage: {
+						type: 'string',
+						required: true,
+						message: '请填写用途',
+						trigger: ['blur', 'change']
+					},
+					carNum: {
+						type: 'number',
+						required: true,
+						message: '请填写乘车人数',
+						trigger: ['blur', 'change']
+					},
+					toEmpsName:{
+						type: 'string',
+						required: true,
+						message: '请选择接收人',
+						trigger: ['blur', 'change']
+					},
+				}
 
 			}
 		},
@@ -237,7 +319,7 @@ import { handleTree } from '../../utils/wjw'
 				this.getPeoList(options.fkFlow)
 			}
 			for(let i in roles){
-				if(roles[i].roleKey == 'chushifzr' && options.fkFlow=='009'){
+				if(roles[i].roleKey == 'chushifzr' && options.fkFlow=='009' || roles[i].roleKey == 'chushifzr' && options.fkFlow=='015' ){
 					this.fzr = true
 					this.getPeoList(options.fkFlow)
 					break
@@ -396,7 +478,46 @@ import { handleTree } from '../../utils/wjw'
 								})
 							})
 							break
-					}
+						case '015':
+							uni.$u.http.post("/offcial/car/startApplyCar", this.content).then(res => {
+								if (res.data.VarAcceptersName != "" && res.data.VarAcceptersName != "结束") {
+									uni.showToast({
+										title: "已发送到" + res.data.VarToNodeName + "节点,接收人:" + res
+											.data.VarAcceptersName,
+										icon: "none",
+										mask: true,
+										duration: 3000
+									})
+								} else if (res.data.VarAcceptersName == "结束") {
+									uni.showToast({
+										title: res.data.Message,
+										icon: "none",
+										mask: true,
+										duration: 3000
+									})
+								} else {
+									uni.showToast({
+										title: res.data.Message.replace(/[@]/g, ""),
+										icon: "none",
+										mask: true,
+										duration: 3000
+									})
+								}
+								uni.$emit('query', {
+									a: 'back'
+								})
+								setTimeout(() => {
+									uni.navigateBack()
+								}, 2000)
+							}).catch(res => {
+								uni.hideLoading()
+								uni.showToast({
+									title: "请稍后重试",
+									icon: "none"
+								})
+							})
+							break
+						}
 				}).catch(errors => {
 					console.log(errors)
 				})
@@ -407,10 +528,12 @@ import { handleTree } from '../../utils/wjw'
 					case '006':
 						this.content.startTime = e[0]
 						this.content.endTime = e[e.length - 1]
+						this.$refs.uForm.validateField("startTime")
 						break
 					case '007':
 						this.content.startTime = e[0]
 						this.content.endTime = e[e.length - 1]
+						this.$refs.uForm.validateField("startTime")
 						break
 					case '009':
 						this.content.leaveStartTime = e[0]
@@ -420,6 +543,17 @@ import { handleTree } from '../../utils/wjw'
 						}else{
 							this.content.leaveNumber = e.length
 						}
+						this.$refs.uForm.validateField("leaveStartTime")
+						break
+					case '015':
+						this.content.startUseTime = e[0]
+						this.content.endUseTime = e[e.length - 1]
+						if(e[0]==e[e.length - 1]){
+							this.content.dayNum = 1
+						}else{
+							this.content.dayNum = e.length
+						}
+						this.$refs.uForm.validateField("startUseTime")
 						break
 				}
 				this.show = false
@@ -487,6 +621,23 @@ import { handleTree } from '../../utils/wjw'
 							this.content.toEmpsName = null
 						}
 						break
+					case '015':
+						this.content = {
+							startUseTime:null,
+							phone:null,
+							endUseTime:null,
+							dayNum:null,
+							addres:null,
+							useMessage:null,
+							carNum:null,
+							createBy:uni.getStorageSync('userInfo').nickName,
+							params:{}
+						}
+						if(this.fzr == true){
+							this.content.params.toEmps = null
+							this.content.toEmpsName = null
+						}
+						break
 				}
 			},
 			getRules(v) {
@@ -500,6 +651,9 @@ import { handleTree } from '../../utils/wjw'
 					case '009':
 						this.rules = this.rules3
 						break
+					case '015':
+						this.rules = this.rules4
+						break
 				}
 			},
 			//获取接收人信息
@@ -512,6 +666,7 @@ import { handleTree } from '../../utils/wjw'
 		},
 		onReady() {
 			//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
+			// if()
 			this.$refs.uForm.setRules(this.rules)
 		},
 	}

+ 5 - 0
pages/staging/staging.vue

@@ -53,6 +53,11 @@
 						<image src="/static/xxfbsh.png" mode="widthFix" style="width: 100rpx;"></image>
 						<text class="grid-text">信息发布审核</text>
 					</u-grid-item>
+					<u-grid-item  @click="dailyWork('用车申请','015',4)">
+						<u-badge style="z-index: 999;" :type="type" max="99" :value="numList['015']" :offset="[-10,10]" :showZero="false" absolute ></u-badge>
+						<image src="/static/usecar.png" mode="widthFix" style="width: 100rpx;"></image>
+						<text class="grid-text">用车申请</text>
+					</u-grid-item>
 				</u-grid>
 			</view>
 		</view>

+ 104 - 1
pages/workInfo/workInfo.vue

@@ -115,6 +115,43 @@
 								</view>
 							</u-form-item>
 						</view>
+						<view v-if="fkFlow == '015'">
+							<u-form-item label="申请人:" borderBottom ref="item1">
+								<view class="content">
+									{{content.createBy}}
+								</view>
+							</u-form-item>
+							<u-form-item label="联系电话:" borderBottom ref="item1">
+								<view class="content">
+									{{content.phone}}
+								</view>
+							</u-form-item>
+							<u-form-item label="起止日期:" borderBottom ref="item1">
+								<view class="content">
+									{{content.startUseTime+' 至 '+content.endUseTime}}
+								</view>
+							</u-form-item>
+							<u-form-item label="用车天数:" borderBottom ref="item1">
+								<view class="content">
+									{{content.dayNum}}天
+								</view>
+							</u-form-item>
+							<u-form-item label="乘车人数:" borderBottom ref="item1">
+								<view class="content">
+									{{content.carNum}}人
+								</view>
+							</u-form-item>
+							<u-form-item label="目的地:" borderBottom ref="item1">
+								<view class="content">
+									{{content.addres}}
+								</view>
+							</u-form-item>
+							<u-form-item label="用途:" borderBottom ref="item1">
+								<view class="content">
+									{{content.useMessage}}
+								</view>
+							</u-form-item>
+						</view>
 						<view v-if="type==0" style="padding-bottom: 40rpx;">
 							<u-form-item label="下一节点:" borderBottom ref="item1" v-if="overType==false">
 								<uni-data-select v-model="content.jdindex" :clear="false" placeholder="请选择下一节点" :localdata="list"
@@ -130,6 +167,13 @@
 								<u--textarea v-model="content.reviewMsg" placeholder="请输入审批意见" autoHeight
 									border="none"></u--textarea>
 							</u-form-item>
+							<view v-if="gdType == true">
+								<u-form-item label="档案分类:" borderBottom  ref="item1" @click="chooseGd">
+									<view :style="{color:content.typeId==null?'rgb(192, 196, 204)':''}">
+										{{content.typeId==null?'请选择档案分类': content.gdtype}}
+									</view>
+								</u-form-item>
+							</view>
 							<view style="margin-top: 40rpx;padding: 0 20rpx;box-sizing: border-box;" v-if="gdType == false">
 								<u-button type="primary" text="提交" @click="submit"  ></u-button>
 							</view>
@@ -399,6 +443,23 @@
 							this.getBackNo(this.parameter.nodeId)
 						}
 					})
+				}else if(this.fkFlow == '015'){
+					uni.$u.http.get('/offcial/car/sel/'+id).then(res=>{
+						this.content = res.data
+						this.content.workid = this.workid
+						if (this.gdType == true) {
+							this.content.typeId = null //归档分类
+							this.content.archiveNo = null //档案编号
+							this.content.archiveFormNo = null
+							this.content.printNum = null //打印份数
+							this.content.name = res.data.title //档案名称
+							this.content.gdtype = null //分类名称
+						}
+						if(this.type==0){
+							this.isOver(this.parameter)
+							this.getBackNo(this.parameter.nodeId)
+						}
+					})
 				}
 				
 			},
@@ -415,7 +476,49 @@
 					})
 				})
 			},
-			
+			//保存归档
+			save(){
+				if(this.content.typeId == null){
+					uni.showToast({
+						title:"请选择归档分类",
+						icon:"none"
+					})
+				}else{
+					this.content.reviewMsg = "同意"
+					uni.showLoading({
+						title:"提交中...",
+						mask:true
+					})
+					uni.$u.http.post("/offcial/archive/save",this.content).then(res=>{
+						uni.$u.http.get('/jflow/restful/GenerNextStepAllNode', {
+							params: {
+								workid:this.parameter.workid,
+								token: uni.getStorageSync('jtoken'),
+								flowNo: this.parameter.flowNo,
+							}
+						}).then(qwe => {
+							uni.hideLoading()
+							uni.showToast({
+								title:"归档成功",
+								icon:"none",
+								mask:true,
+								duration:2000
+							})
+							uni.$emit('query' , {a : 'back'})
+							setTimeout(()=>{
+								  uni.navigateBack()
+							},2000)
+						})
+					}).catch(res=>{
+						uni.hideLoading()
+						uni.showToast({
+							title:"请稍后重试",
+							icon:"none"
+						})
+					})
+					
+				}
+			},
 			//查询流转记录
 			getRecord(id) {
 				uni.$u.http.get('/jflow/restful/getWfGenerWorkList', {

BIN
static/usecar.png


+ 1 - 1
utils/request/index.js

@@ -1,7 +1,7 @@
 // 根域名
 var baseUrl = 'http://121.28.24.104:13898/app/';
 // var baseUrl = 'http://192.168.1.59:8080';
-// var baseUrl = 'http://192.168.1.52:8080';
+// var baseUrl = 'http://192.168.1.42:8080';
  
 module.exports = (vm) => {
     // 初始化请求配置:config 为默认全局配置