Procházet zdrojové kódy

完成接口对接和页面样式

LuChongMei před 1 rokem
rodič
revize
a96dd83007

+ 36 - 12
jp-mobile/pages/fileTransmit/addFileTransmit.vue

@@ -48,12 +48,12 @@
 				<u-upload :fileList="imgList" multiple :maxCount="imgList.length" :previewFullImage="true"></u-upload>
 				<u--text size="12" type="error" text="请确保上传图片内容清晰可见,所有涉密敏感信息不得上传"></u--text>
 				<view class="submit_btn flex">
-					<u-button type="primary" text="提交新增" @click="formSubmit"></u-button>
+					<u-button v-if="!loading" type="primary" text="提交新增" @click="formSubmit"></u-button>
+					<u-button v-if="loading" :loading="loading" type="primary" text="加载中"></u-button>
 				</view>
 			</u--form>
-
-
 		</view>
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
@@ -65,6 +65,7 @@
 	export default {
 		data() {
 			return {
+				loading: false,
 				fileLists: [],
 				fileList: [],
 				imgList: [],
@@ -85,6 +86,16 @@
 			}
 		},
 		methods: {
+			showToast(params) {
+				this.$refs.uToast.show({
+					...params,
+					complete() {
+						params.url && uni.navigateTo({
+							url: params.url
+						})
+					}
+				})
+			},
 			// 新增图片
 			async afterRead(event) {
 				// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
@@ -138,17 +149,30 @@
 			},
 			// 表单提交
 			formSubmit() {
+				this.loading = true
 				// this.$refs['inputForm'].validate((valid) => {
 				// 	if (valid) {
-						gwCirculationCard2Service.save(this.inputForm).then((data) => {
-							
-							this.$message.success(data)
-							 uni.reLaunch({
-							        url: '/pages/fileTransmit/addFileTransmit' 
-							      });
-						}).catch(() => {
-							
-						})
+				gwCirculationCard2Service.save(this.inputForm).then((data) => {
+
+					let param = {
+						type: 'success',
+						message: data,
+						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png',
+					}
+					this.showToast(param);
+					setTimeout(() => {
+						uni.redirectTo({
+							url: '/pages/fileTransmit/addFileTransmit'
+						});
+					}, 500)
+				}).catch(() => {
+					let param = {
+						type: 'error',
+						message: data,
+						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png',
+					}
+					this.showToast(param);
+				})
 				// 	}
 				// })
 			}

+ 55 - 32
jp-mobile/pages/fileTransmit/examineFile.vue

@@ -5,7 +5,8 @@
 			<view class="office_title">
 				<uni-section v-if="isoffice" titleColor="#36a7f3" class="mb-10" title="办公室拟办" type="line"></uni-section>
 				<uni-section v-if="isleader" titleColor="#36a7f3" class="mb-10" title="领导批示" type="line"></uni-section>
-				<uni-section v-if="isundertake" titleColor="#36a7f3" class="mb-10" title="承办科室" type="line"></uni-section>
+				<uni-section v-if="isundertake" titleColor="#36a7f3" class="mb-10" title="承办科室"
+					type="line"></uni-section>
 			</view>
 			<view class="office_info">
 				<u--form v-if="isoffice" :model="auditForm" labelWidth="130px" class="u-form default_title"
@@ -30,7 +31,7 @@
 						</signInput>
 					</u-form-item>
 					<view class="submit_btn flex ">
-						<u-button v-if="isAll" @click="formSubmit"  type="success" text="归档"></u-button>
+						<u-button v-if="isAll" @click="formSubmit" type="success" text="归档"></u-button>
 						<u-button v-if="!show && one" :disabled="!auditForm.nextLeadUser!=''" type="primary" text="确认签字"
 							@click="show = true"></u-button>
 						<u-button v-if="show || !one" type="primary" text="提交" @click="doSubmit"></u-button>
@@ -47,8 +48,7 @@
 						</signInput>
 					</u-form-item>
 					<view class="submit_btn flex ">
-						<u-button v-if="!show" type="primary" text="确认签字"
-							@click="show = true"></u-button>
+						<u-button v-if="!show" type="primary" text="确认签字" @click="show = true"></u-button>
 						<u-button v-if="show" type="primary" text="提交" @click="doSubmit"></u-button>
 					</view>
 				</u--form>
@@ -63,14 +63,14 @@
 						</signInput>
 					</u-form-item>
 					<view class="submit_btn flex ">
-						<u-button v-if="!show" type="primary" text="确认签字"
-							@click="show = true"></u-button>
+						<u-button v-if="!show" type="primary" text="确认签字" @click="show = true"></u-button>
 						<u-button v-if="show" type="primary" text="提交" @click="doSubmit"></u-button>
 					</view>
 				</u--form>
 			</view>
 		</view>
 		<u-toast ref="uToast"></u-toast>
+
 	</view>
 
 </template>
@@ -87,20 +87,20 @@
 		onLoad(option) {
 			this.gwId = option.id
 			gwFlowService.queryByGwId(this.gwId).then(data => {
-				if(data.length>1) this.one = false
+				if (data.length > 1) this.one = false
 				let user = $auth.getUserInfo()
 				let role = $auth.getUserInfo().roleNames
-				let gw = data.filter(item =>{
-				return item.nextUser == user.id && item.state == 1	
+				let gw = data.filter(item => {
+					return item.nextUser == user.id && item.state == 1
 				})
 				let down = data.filter(item => item.state == 0)
-				if(down.length == data.length) this.isAll =true
-				if(gw.length>0){
+				if (down.length == data.length) this.isAll = true
+				if (gw.length > 0) {
 					this.auditForm = gw[0]
 				}
-				if(role == '办公室主任') this.isoffice = true
-				if(role == '局领导' && gw.length>0) this.isleader = true
-				if(role == '科室负责人'&& gw.length>0) this.isundertake = true
+				if (role == '办公室主任') this.isoffice = true
+				if (role == '局领导' && gw.length > 0) this.isleader = true
+				if (role == '科室负责人' && gw.length > 0) this.isundertake = true
 			})
 		},
 		components: {
@@ -109,7 +109,7 @@
 			officeUserSelect
 		},
 		mounted() {
-			
+
 			this.searchForm.officeDTO.id = "1770354910488272897"
 			userService.list({
 				current: this.tablePage.currentPage,
@@ -122,9 +122,10 @@
 		},
 		data() {
 			return {
-				isAll:false,
+
+				isAll: false,
 				show: false,
-				one:true,
+				one: true,
 				action: "", //上传服务器的地址
 				header: {}, //图片上传携带头部信息
 				auditForm: {
@@ -146,7 +147,7 @@
 				gwId: "",
 				isoffice: false,
 				isleader: false,
-				isundertake:false,
+				isundertake: false,
 				leaderList: [],
 				tablePage: {
 					total: 0,
@@ -195,31 +196,53 @@
 			},
 			// 提交表单
 			doSubmit() {
-				if(this.auditForm.nextLeadUser!=''||this.auditForm.nextDepUser!='') this.auditForm.next = '1'
+				if (this.auditForm.nextLeadUser != '' || this.auditForm.nextDepUser != '') this.auditForm.next = '1'
 				this.auditForm.state = "0"
 				gwFlowService.save(this.auditForm).then(data => {
 					let param = {
-						type:'success',
-						message:data,
+						type: 'success',
+						message: data,
 						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png',
-						url: 'pages/fileTransmit/fileTransmitList?type=1',
+					}
+					this.showToast(param);
+					setTimeout(() => {
+						uni.redirectTo({
+							url: 'pages/fileTransmit/fileTransmitList?type=1'
+						});
+					}, 500)
+				}).catch(() => {
+					let param = {
+						type: 'error',
+						message: data,
+						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png',
 					}
 					this.showToast(param);
 				})
 			},
 			// 归档
-			formSubmit(){
-				gwCirculationCard2Service.queryById(this.gwId).then(data =>{
+			formSubmit() {
+				gwCirculationCard2Service.queryById(this.gwId).then(data => {
 					data.state = '3'
-					gwCirculationCard2Service.save(data).then(res =>{
+					gwCirculationCard2Service.save(data).then(res => {
 						let param = {
-							type:'success',
-							message:res,
-							iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png',
-							url: 'pages/fileTransmit/fileTransmitList?type=3',
-						}
-						this.showToast(param);
-					})
+								type: 'success',
+								message: data,
+								iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png',
+							}
+							this.showToast(param);
+							setTimeout(() => {
+								uni.redirectTo({
+									url: 'pages/fileTransmit/fileTransmitList?type=3'
+								});
+							}, 500)
+						}).catch(() => {
+							let param = {
+								type: 'error',
+								message: data,
+								iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png',
+							}
+							this.showToast(param);
+						})
 				})
 			}
 		}

+ 18 - 8
jp-mobile/pages/fileTransmit/fileCard.vue

@@ -64,7 +64,7 @@
 							</view>
 							<view class="flex " style="line-height: 20px;">
 								<u--image :src="src" width="80px" height="20px"></u--image>
-								{{item.createTime}}
+								{{item.updateTime}}
 							</view>
 						</view>
 					</u-col>
@@ -80,7 +80,7 @@
 							</view>
 							<view class="flex " style="line-height: 20px;">
 								<u--image :src="src" width="80px" height="20px"></u--image>
-								{{leader.createTime}}
+								{{leader.updateTime}}
 							</view>
 						</view>
 					</u-col>
@@ -91,16 +91,16 @@
 					</u-col>
 					<u-col span="11" class="info_abstract">
 						<view v-for="item in undertakeInfo" class="info_abstract_v">
-							{{item.content}} {{item.createTime}}
+							{{item.content}} {{item.updateTime}}
 						</view>
 					</u-col>
 				</u-row>
-				<u-row v-if="officeInfo.length>0" justify="space-between" class="card_row card_row_border">
+				<u-row justify="space-between" class="card_row card_row_border">
 					<u-col span="3" textAlign="center" class="card_col">
 						<view>备注</view>
 					</u-col>
 					<u-col span="9" textAlign="center">
-						<view v-for="item in officeInfo">{{item.remark}}</view>
+						<view>{{inputForm.remark}}</view>
 					</u-col>
 				</u-row>
 				<u--text style="margin: 10px;" size="12" type="error" text="所有涉密敏感信息不得上传"></u--text>
@@ -117,6 +117,11 @@
 			</view>
 
 		</view>
+		<u-overlay :show="ismask">
+				<view class="warp">
+					<view class="rect"><u-button plain loading loadingText="加载中"></u-button></view>
+				</view>
+			</u-overlay>
 	</view>
 </template>
 
@@ -130,12 +135,10 @@
 	export default {
 		mounted() {
 			gwCirculationCard2Service.queryById(this.gwId).then(data => {
-				console.log("data========", data);
 				this.inputForm = data
 				this.inputForm.receivingTime = this.inputForm.receivingTime.substring(5, 10)
 			})
 			gwFlowService.queryByGwId(this.gwId).then(data => {
-				console.log("data========", data);
 				data.forEach(item =>{
 					if(item.which == 0 && item.state ==0) {
 						this.officeInfo.push(item)
@@ -145,7 +148,7 @@
 						this.undertakeInfo.push(item)
 					}
 				})
-				
+				this.ismask = false
 			})
 			this.fileLists.forEach(item => {
 				if (isImageFormat(item.url)) {
@@ -162,6 +165,7 @@
 		},
 		data() {
 			return {
+				ismask:true,
 				src: 'https://cdn.uviewui.com/uview/album/1.jpg',
 				// 公文附件
 				fileLists: [],
@@ -225,6 +229,12 @@
 </script>
 
 <style>
+	.warp {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			height: 100%;
+		}
 	.card_main {
 		width: 100%;
 		background-color: #fefefe;

+ 53 - 9
jp-mobile/pages/fileTransmit/fileInfo.vue

@@ -1,22 +1,65 @@
 <template>
 	<view class="info_page">
-		<fileCard :isinfo="true"></fileCard>
+		<fileCard :gwId="gwId"></fileCard>
 		<view class="info_main">
-			<u-steps current="0" direction="column" inactiveColor="#36a7f3" activeColor="#5fdf50">
-					<u-steps-item title="办公室拟办" desc="名字 - 2024-3-21 00:00">
-					</u-steps-item>
-					<u-steps-item title="领导审批" desc="名字 - 2024-3-21 00:00" ></u-steps-item>
-					<u-steps-item title="承办情况" ></u-steps-item>
-				</u-steps>
+			<u-steps :current="current" direction="column" inactiveColor="#36a7f3" activeColor="#5fdf50">
+				<u-steps-item v-for="item in downList" :title="item.which=='0'?'办公室拟办':item.which=='1'?'领导审批':'承办情况'"
+					:desc="item.nextTruename +' - '+item.updateTime">
+				</u-steps-item>
+				<u-steps-item v-for="item in officeInfo" title="办公室拟办" :desc="item.nextTruename +' - '+item.updateTime">
+				</u-steps-item>
+				<u-steps-item title="领导审批" v-for="item in leaderInfo"
+					:desc="item.nextTruename +' - '+item.updateTime"></u-steps-item>
+				<u-steps-item title="承办情况" v-for="item in undertakeInfo"
+					:desc="item.nextTruename +' - '+item.updateTime"></u-steps-item>
+			</u-steps>
 		</view>
 	</view>
 </template>
 
 <script>
 	import fileCard from "./fileCard.vue"
-	export default{
-		components:{
+	import gwFlowService from '@/api/circulation/gwFlowService.js'
+	import gwCirculationCard2Service from '@/api/circulation/gwCirculationCard2.js'
+	export default {
+		onLoad(option) {
+			this.gwId = option.id
+
+		},
+		components: {
 			fileCard,
+		},
+		data() {
+			return {
+				gwId: '',
+				// 办公室信息
+				officeInfo: [],
+				// 领导信息
+				leaderInfo: [],
+				// 承办信息
+				undertakeInfo: [],
+				downList: [],
+				current: 0
+			}
+		},
+		mounted() {
+			gwFlowService.queryByGwId(this.gwId).then(data => {
+				console.log("data========", data);
+				data.forEach(item => {
+					if (item.state == 0) this.downList.push(item)
+					if (item.which == 0 && item.state == 1) {
+						this.officeInfo.push(item)
+					} else if (item.which == 1 && item.state == 1) {
+						if (item.state == 1) this.current = 1
+						this.leaderInfo.push(item)
+					} else if (item.which == 2 && item.state == 1) {
+						if (item.state == 1) this.current = 2
+						this.undertakeInfo.push(item)
+					}
+				})
+				this.downList.sort((a, b) => a.createTime.localeCompare(b.createTime) || a.createTime.localeCompare(b.createTime));
+				this.current = this.downList.length
+			})
 		}
 	}
 </script>
@@ -26,6 +69,7 @@
 		width: 100%;
 		background-color: #fefefe;
 	}
+
 	.info_main {
 		margin: 20px;
 	}

+ 35 - 9
jp-mobile/pages/fileTransmit/fileTransmitList.vue

@@ -29,11 +29,14 @@
 				</u-cell>
 			</u-cell-group>
 		</view>
+		<u-loadmore :status="status" />
 	</view>
 </template>
 
 <script>
 	import gwCirculationCard2Service from '@/api/circulation/gwCirculationCard2.js'
+	import gwFlowService from '@/api/circulation/gwFlowService.js'
+	import * as $auth from "@/common/auth.js"
 	export default {
 		onLoad(option) {
 			if (option) {
@@ -77,14 +80,36 @@
 		methods: {
 			// 查看详情
 			toInfo(item) {
-				if(this.type==3 ){
+				if (this.type == 3) {
 					uni.navigateTo({
-						url: '/pages/fileTransmit/fileInfo?id='+item.id
-					})
-				}else {
-					uni.navigateTo({
-					    url: '/pages/fileTransmit/examineFile?id='+item.id
+						url: '/pages/fileTransmit/fileInfo?id=' + item.id
 					})
+				} else {
+					let user = $auth.getUserInfo()
+					let role = $auth.getUserInfo().roleNames
+					if (role == '办公室主任') {
+						uni.navigateTo({
+							url: '/pages/fileTransmit/examineFile?id=' + item.id
+						})
+					} else {
+						gwFlowService.queryByGwId(item.id).then(data => {
+							let gw = data.filter(item => {
+								return item.nextUser == user.id && item.state == 1
+							})
+							if (gw.length > 0) {
+								uni.navigateTo({
+									url: '/pages/fileTransmit/examineFile?id=' + item.id
+								})
+							} else {
+								uni.navigateTo({
+									url: '/pages/fileTransmit/fileInfo?id=' + item.id
+								})
+							}
+
+						})
+					}
+
+
 				}
 			},
 			// 搜索
@@ -107,13 +132,14 @@
 				this.tablePage.currentPage = ++this.tablePage.currentPage;
 				//联网加载数据
 				this.status = 'loading';
+				let {createTime,...newForm} = this.searchForm
 				gwCirculationCard2Service.list({
 					current: this.tablePage.currentPage,
 					size: this.tablePage.pageSize,
 					orders: this.tablePage.orders,
-					// beginCreateDate: this.searchForm.createDate ? this.searchForm.createDate[0] : '',
-					// endCreateDate: this.searchForm.createDate ? this.searchForm.createDate[1] : '',
-					...this.searchForm
+					beginCreateDate: this.searchForm.createTime ? this.searchForm.createTime[0] : '',
+					endCreateDate: this.searchForm.createTime ? this.searchForm.createTime[1] : '',
+					...newForm
 				}).then((data) => {
 					//追加新数据
 					this.dataList = this.dataList.concat(data.records);

+ 4 - 4
jp-mobile/pages/workbench/workbench.vue

@@ -51,10 +51,10 @@
 					<view ><u--image src="/static/index/icon2.png" width="40px" height="40px"></u--image></view>
 					<text>已归档</text>
 				</view>
-				<view @tap="" class="circle-button-box">
+				<!-- <view @tap="toPerson" class="circle-button-box">
 					<view ><u--image src="/static/index/icon3.png" width="40px" height="40px"></u--image></view>
 					<text>通讯录</text>
-				</view>
+				</view> -->
 				<view @tap="toApplyList" class="circle-button-box">
 					<view ><u--image src="/static/index/icon6.png" width="40px" height="40px"></u--image></view>
 					<text>公文统计</text>
@@ -157,9 +157,9 @@
 				    url: '/pages/fileTransmit/addFileTransmit'
 				})
 			},
-			examine (mail) {
+			toPerson (mail) {
 				uni.navigateTo({
-				    url: '/pages/fileTransmit/examineFile'
+				    url: "/pages/index/index?type='addressbook'"
 				})
 			},
 			toList (type) {