lsw 1 jaar geleden
bovenliggende
commit
a353f147d8

+ 1 - 1
admin-ui/.env.production

@@ -5,4 +5,4 @@ VUE_APP_TITLE = 承揽时代云平台
 ENV = 'production'
 
 # 承揽时代云平台/生产环境
-VUE_APP_BASE_API = '/prod'
+VUE_APP_BASE_API = '/prod-api'

+ 1 - 1
admin-ui/src/assets/styles/extend.scss

@@ -324,7 +324,7 @@
 }
 .sfz {
   border-radius: 5px;
-  width: 130px;
+  max-height: 120px;
 }
 .bs {
   color: darkgray;

+ 22 - 4
admin-ui/src/components/preview.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
-    <span @click="preview()" class="pre">点击查看</span>
-    <el-image v-if="value" ref="preview" class="hideImgDiv" :src="baseUrl + value" :preview-src-list="[baseUrl + value]"></el-image>
+    <span @click="preview()" class="pre">{{ msg }}</span>
+    <el-image v-if="value" ref="preview" class="hideImgDiv" :src="list[0]" :preview-src-list="list"></el-image>
   </div>
 </template>
 
@@ -11,10 +11,28 @@ export default {
     value: {
       type: String,
       default: {}
+    },
+    msg: {
+      type: String,
+      default: '点击查看'
     }
   },
   data() {
-    return {};
+    return {
+      list: []
+    };
+  },
+  watch: {
+    value: {
+      handler(newValue, oldValue) {
+        newValue.split(',').forEach((item) => {
+          this.list.push(this.baseUrl + item);
+          // item = this.baseUrl + item;
+          console.log('asd:' + item);
+        });
+      },
+      immediate: true
+    }
   },
   methods: {
     preview() {
@@ -25,7 +43,7 @@ export default {
 </script>
 <style lang="scss" scoped>
 .hideImgDiv {
-  display: none!important;
+  display: none !important;
 }
 .pre {
   color: #1890ff;

+ 1 - 1
admin-ui/src/views/work/project/index.vue

@@ -126,7 +126,7 @@ export default {
       }
       const id = row.id || this.ids[0];
       if (tag == 'packages') {
-        this.iframe({ obj: packages, param: { projectId: row.id }, title: '接包明细', width: '70%', height: '75%' });
+        this.iframe({ obj: packages, param: { projectId: row.id }, title: '接包明细', width: '75%', height: '75%' });
       }
       if (tag == 'detail') {
         this.iframe({ obj: edit, param: { id: id, detail: true }, title: '项目详情', width: '55%', height: '55%' });

+ 49 - 5
admin-ui/src/views/work/project/packages/index.vue

@@ -17,15 +17,32 @@
       <el-button type="primary" icon="el-icon-download" @click="handleExport" style="float: right">导出</el-button>
     </el-form>
     <el-table :data="response.rows" border>
-      <el-table-column type="index" label="序号" align="center" width="80" />
-      <el-table-column label="姓名" align="center" prop="name" />
+      <el-table-column type="index" label="序号" align="center" width="70" />
+      <el-table-column label="姓名" align="center" prop="name" width="100" />
       <el-table-column label="身份证" align="center" prop="idCard" />
-      <el-table-column label="手机号" align="center" prop="phone" />
+      <el-table-column label="手机号" align="center" prop="phone" width="120" />
       <el-table-column label="支付宝账号" align="center" prop="alipay" />
-      <el-table-column label="接包日期" align="center" prop="createTime" />
-      <el-table-column label="操作" align="center">
+      <el-table-column label="上传凭证" align="center" width="130">
+        <template slot-scope="scope">
+          <el-tag type="danger" v-if="scope.row.audit == 0">待上传</el-tag>
+          <el-tag type="info" v-if="scope.row.audit == 1">待审核</el-tag>
+          <el-tag type="success" v-if="scope.row.audit == 2">已审核</el-tag>
+          <preview v-model="scope.row.voucher" v-if="scope.row.audit != 0 && scope.row.audit != 3" msg="查看" style="float: right"></preview>
+          <el-popover placement="top-start" v-if="scope.row.audit == 3" title="原因" width="200" trigger="hover" :content="scope.row.msg">
+            <div slot="reference">
+              <el-tag type="info">驳回</el-tag>
+              <i class="el-icon-warning"></i>
+              <preview v-model="scope.row.voucher" v-if="scope.row.audit != 0" msg="查看" style="float: right"></preview>
+            </div>
+          </el-popover>
+        </template>
+      </el-table-column>
+      <el-table-column label="接包日期" align="center" prop="createTime" width="160" />
+      <el-table-column label="操作" align="center" width="250">
         <template slot-scope="scope">
           <el-button size="mini" type="text" icon="el-icon-document" @click="op('contract', scope.row)">查看合同</el-button>
+          <el-button size="mini" type="text" icon="el-icon-check" @click="op('success', scope.row)" v-if="scope.row.audit == 1">确认</el-button>
+          <el-button size="mini" type="text" icon="el-icon-close" @click="op('reject', scope.row)" v-if="scope.row.audit == 1">驳回</el-button>
           <el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)">详情</el-button>
         </template>
       </el-table-column>
@@ -87,9 +104,36 @@ export default {
       this.handleQuery();
     },
     op(tag, row) {
+      const id = row.id;
       if (tag == 'detail') {
         this.iframe({ obj: info, param: { id: row.userId, detail: true }, title: '查看详情', width: '55%', height: '60%' });
       }
+      if (tag == 'success') {
+        this.$confirm('是否确认审核通过?', '警告', { type: 'warning' }).then(() => {
+          this.ajax({ url: '/work/packages/success/' + id }).then((response) => {
+            this.$modal.msgSuccess('审核成功');
+            this.getList();
+          });
+        });
+      }
+      if (tag == 'reject') {
+        this.$prompt('确定审核驳回', {
+          type: 'warning',
+          showInput: true,
+          inputType: 'textarea',
+          inputPlaceholder: '驳回原因',
+          inputValidator: (value) => {
+            if (!value) {
+              return '请输入驳回原因';
+            }
+          }
+        }).then(({ value }) => {
+          this.ajax({ method: 'post', url: '/work/packages/reject', data: { id: id, msg: value } }).then((response) => {
+            this.$modal.msgSuccess('驳回成功');
+            this.getList();
+          });
+        });
+      }
       if (tag == 'contract') {
         this.iframe({ obj: contract, param: { id: row.userId }, title: '查看合同', width: '55%', height: '85%' });
       }

+ 1 - 1
admin-ui/src/views/work/relate/index.vue

@@ -77,7 +77,7 @@ export default {
     },
     op(tag, row) {
       if (tag == 'detail') {
-        this.iframe({ obj: info, param: { id: row.userId, detail: true }, title: '查看详情', width: '55%', height: '60%' });
+        this.iframe({ obj: info, param: { id: row.userId, detail: true }, title: '查看详情', width: '55%', height: '65%' });
       }
       if (tag == 'contract') {
         this.iframe({ obj: contract, param: { id: row.userId }, title: '查看合同', width: '55%', height: '85%' });

+ 1 - 0
admin-ui/vue.config.js

@@ -36,6 +36,7 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         target: `http://localhost:9191`,
+        //target: `http://47.104.228.216/prod-api`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''

+ 1 - 1
app/App.vue

@@ -30,7 +30,7 @@ button::after {
 /**挂载iconfont字体图标*/
 @font-face {
 	font-family: 'iconfont';
-	src: url('https://at.alicdn.com/t/c/font_4507607_8bhjcwoky4e.ttf?t=1713424601890') format('truetype');
+	src: url('https://at.alicdn.com/t/c/font_4507607_2mqpdhbkr2t.ttf?t=1714027733527') format('truetype');
 	/* src: url('~@/static/font/iconfont.ttf') format('truetype'); */
 }
 .icon {

+ 14 - 9
app/common/common.scss

@@ -1,6 +1,6 @@
-.main{
+.main {
 	padding: 15px;
-	.form{
+	.form {
 		border-radius: 10px;
 		background-color: white;
 	}
@@ -195,8 +195,8 @@
 		color: $font-c;
 		overflow: hidden;
 		border-bottom: 1px solid #f0f2f7;
-		&:last-child{
-			border-bottom:0px;
+		&:last-child {
+			border-bottom: 0px;
 		}
 		.ic {
 			float: left;
@@ -205,7 +205,7 @@
 			padding: 7px;
 			border-radius: 50%;
 			border: 1px solid $main-color;
-			color:$main-color;
+			color: $main-color;
 		}
 		.title {
 			color: #545555;
@@ -221,15 +221,20 @@
 		}
 	}
 }
-.tips{
+.tips {
 	font-size: 13px;
-	background-color:$bg;
+	background-color: $bg;
 	padding: 8px;
 	color: $main-color;
 	overflow: hidden;
-	.icon{
+	.icon {
 		font-size: 17px;
 		float: left;
 		padding-right: 3px;
 	}
-}
+}
+.popup {
+	padding: 15px;
+	background-color: white;
+	border-radius: 10px;
+}

+ 16 - 2
app/components/card/card.vue

@@ -64,7 +64,6 @@ export default {
 								let data = JSON.parse(res.data);
 								if (data.code == 200) {
 									this.fileName = data.fileName;
-									this.$emit('input', data.fileName);
 									this.ocr({ imageUrl: this.ip + data.fileName, side: this.side });
 								} else {
 									uni.showModal({ content: data.msg, showCancel: false });
@@ -86,7 +85,22 @@ export default {
 				data: item,
 				method: 'POST',
 				success: (res) => {
-					this.$emit('success', { side: this.side, data: res.data.data });
+					if (this.side == 'face') {
+						if (res.data.data) {
+							this.$emit('input', this.fileName);
+							this.$emit('success', { side: this.side, data: res.data.data });
+						} else {
+							uni.showModal({ content: '请上传正确的身份证人像面', showCancel: false });
+						}
+					}
+					if (this.side == 'back') {
+						if (res.data.data) {
+							this.$emit('input', this.fileName);
+							this.$emit('success', { side: this.side, data: res.data.data });
+						} else {
+							uni.showModal({ content: '请上传正确的身份证国徽面', showCancel: false });
+						}
+					}
 				}
 			});
 		},

+ 150 - 0
app/components/images/images.vue

@@ -0,0 +1,150 @@
+<template>
+	<view class="imgs">
+		<view class="photo" v-for="(item, index) in list" :key="index" @click="preview(item)">
+			<image :src="ip + item" mode="aspectFill"></image>
+			<text class="del" @click.stop="del(item)" v-if="!read">删除</text>
+		</view>
+		<view class="uploads" v-if="list.length < 3 && !read" @click="chooseImage()">
+			<view class="bw">
+				<view class="icon">&#xe65c;</view>
+				<view class="text" style="color: rgb(145 154 179)">选择图片</view>
+			</view>
+		</view>
+		<view class="clear"></view>
+	</view>
+</template>
+
+<script>
+export default {
+	name: 'images',
+	props: {
+		value: {
+			type: Array
+		},
+		read: {
+			type: Boolean,
+			default: false
+		}
+	},
+	data() {
+		return {
+			ip: this.http.ip,
+			list: []
+		};
+	},
+	watch: {
+		value: {
+			handler(newValue, oldValue) {
+				this.list = newValue;
+			},
+			immediate: true
+		}
+	},
+	methods: {
+		chooseImage() {
+			//照片选择
+			uni.chooseImage({
+				count: 3, //默认9
+				sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
+				success: (res) => {
+					res.tempFilePaths.forEach((path) => {
+						uni.showLoading({ title: '正在上传图片', mask: true });
+						uni.uploadFile({
+							url: this.ip + '/app/common/upload',
+							filePath: path,
+							name: 'file',
+							header: { Authorization: this.getUser().token },
+							success: (res) => {
+								let data = JSON.parse(res.data);
+								if (data.code == 200) {
+									console.log('asd:' + data.fileName);
+									if (this.list.length < 3) {
+										this.list.push(data.fileName);
+									}
+									this.$emit('input', this.list);
+								}
+								uni.hideLoading();
+							},
+							fail: (res) => {
+								uni.hideLoading();
+								uni.showModal({ content: '图片上传失败', showCancel: false });
+							}
+						});
+					});
+				}
+			});
+		},
+		preview(item) {
+			let urls = [];
+			this.value.forEach((item) => {
+				urls.push(this.ip + item);
+			});
+			// 预览图片
+			uni.previewImage({
+				urls: urls,
+				current: this.ip + item,
+				success: (res) => {}
+			});
+		},
+		del(item) {
+			this.value.splice(this.value.indexOf(item), 1);
+			this.$emit('input', this.value);
+			this.$forceUpdate();
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.imgs {
+	margin-top: 10px;
+	.uploads {
+		float: left;
+		width: 80px;
+		height: 80px;
+		text-align: center;
+		border-radius: 5px;
+		margin: 5px 5px 0px 0px;
+		overflow: hidden;
+		background-color: white;
+		border: 1px solid #e2e2e2;
+		.bw {
+			padding-top: 10px;
+			.icon {
+				font-size: 30px;
+				display: block;
+				float: none;
+			}
+			.text {
+				font-size: 14px;
+				color: #6c6c6c;
+			}
+		}
+	}
+	.photo {
+		float: left;
+		margin: 5px 10px 0px 0px;
+		position: relative;
+		overflow: hidden;
+		border-radius: 5px;
+		width: 80px;
+		height: 80px;
+
+		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2);
+		image {
+			width: 80px;
+			height: 80px;
+			border-radius: 5px;
+		}
+		.del {
+			position: absolute;
+			top: 0px;
+			right: 0px;
+			background-color: #f44336;
+			color: white;
+			padding: 2px 6px;
+			font-size: 12px;
+		}
+	}
+}
+</style>

+ 14 - 19
app/components/signature/signature.vue

@@ -350,25 +350,20 @@ export default {
 </script>
 
 <style lang="scss">
-.popup {
-	padding: 15px;
-	background-color: white;
-	border-radius: 10px;
-	.signature-contain {
-		width: 100%;
-		.signature-main {
-			.title {
-				text-align: center;
-			}
-			.signature {
-				width: 100%;
-				border: 1px dotted black;
-				border-bottom: 1px dotted black;
-				margin: 10px 0;
-			}
-			.btn {
-				margin-top: 10px;
-			}
+.signature-contain {
+	width: 100%;
+	.signature-main {
+		.title {
+			text-align: center;
+		}
+		.signature {
+			width: 100%;
+			border: 1px dotted black;
+			border-bottom: 1px dotted black;
+			margin: 10px 0;
+		}
+		.btn {
+			margin-top: 10px;
 		}
 	}
 }

+ 68 - 0
app/components/voucher/voucher.vue

@@ -0,0 +1,68 @@
+<template>
+	<view v-if="show">
+		<u-popup :show="show" round="15" mode="center" :closeable="true" :customStyle="{ width: '95%' }" @close="show = false">
+			<view class="popup">
+				<u-divider text="上传凭证(最多3张)"></u-divider>
+				<view class="bbg">
+					<images v-model="item.voucher" :read="item.audit == 2"></images>
+				</view>
+				<view class="tips" v-if="item.audit == 1">
+					<text class="icon">&#xe600;</text>
+					<text>等待企业方确认凭证</text>
+				</view>
+				<view class="tips" v-if="item.audit == 3">
+					<text class="icon">&#xe600;</text>
+					<text>审核不通过:{{ item.msg }}</text>
+				</view>
+				<button class="btn" @click="add()" v-if="item.audit != 2">{{ item.audit == 3 ? '重新上传' : '立即提交' }}</button>
+			</view>
+		</u-popup>
+	</view>
+</template>
+
+<script>
+export default {
+	name: 'voucher',
+	data() {
+		return {
+			show: false,
+			item: { voucher: [] }
+		};
+	},
+	methods: {
+		init(data) {
+			this.show = true;
+			this.item = data;
+			this.item.voucher = this.item.voucher ? this.item.voucher.split(',') : [];
+		},
+		add() {
+			this.http.request({
+				url: '/app/packages/voucher',
+				data: { id: this.item.id, voucher: this.item.voucher.toString() },
+				method: 'POST',
+				success: (res) => {
+					uni.showModal({
+						title: '提示',
+						content: '提交成功',
+						showCancel: false,
+						success: (res) => {
+							this.show = false;
+							this.$emit('success');
+						}
+					});
+				}
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.tips {
+	border-radius: 5px;
+	margin-top: 15px;
+}
+.btn {
+	margin-top: 20px;
+}
+</style>

+ 9 - 5
app/pages/auth/index.vue

@@ -24,11 +24,11 @@
 				<view class="form">
 					<view class="form_group">
 						<view class="lable re">姓名</view>
-						<input type="text" placeholder="请输入姓名" v-model="item.name" />
+						<input type="text" placeholder="请输入姓名" v-model="item.name" :disabled="true" />
 					</view>
 					<view class="form_group">
 						<view class="lable re">身份证</view>
-						<input type="text" placeholder="请输入身份证" v-model="item.idCard" />
+						<input type="text" placeholder="请输入身份证" v-model="item.idCard" :disabled="true" />
 					</view>
 				</view>
 				<view class="form" style="margin-top: 15px">
@@ -37,7 +37,7 @@
 						<input type="text" placeholder="请输入手机号" v-model="item.phone" />
 					</view>
 					<view class="form_group">
-						<view class="lable re">支付宝账号</view>
+						<view class="lable re">支付宝</view>
 						<input type="text" placeholder="请输入支付宝账号" v-model="item.alipay" />
 					</view>
 				</view>
@@ -99,8 +99,12 @@ export default {
 			}
 		},
 		next() {
-			if (!this.item.p1 && !this.item.p2) {
-				uni.showModal({ content: '请先上传证件照', showCancel: false });
+			if (!this.item.name) {
+				uni.showModal({ content: '请上传身份证人像面', showCancel: false });
+				return;
+			}
+			if (!this.item.endDate) {
+				uni.showModal({ content: '请上传身份证国徽面', showCancel: false });
 				return;
 			}
 			this.step = 2;

+ 18 - 4
app/pages/packages/index.vue

@@ -24,13 +24,16 @@
 				<view class="op">
 					<text>{{ item.createTime }}</text>
 					<text class="add" @click="add(item)" v-if="current == 0">接包</text>
-					<text v-if="current == 1" class="state">已接包</text>
+					<text class="add" @click="voucher(item)" v-if="current == 1 && item.audit == 0">上传凭证</text>
+					<text class="add" @click="voucher(item)" v-if="current == 1 && item.audit == 1">已上传凭证</text>
+					<text class="add" @click="voucher(item)" v-if="current == 1 && item.audit == 3" style="background-color: #f44336">凭证驳回,请重新上传</text>
 					<text v-if="current == 2" class="state">已完成</text>
 				</view>
 			</view>
 			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
 			<u-empty v-if="!loadMore && list.length == 0"></u-empty>
 		</view>
+		<voucher ref="voucher" @success="success()"></voucher>
 	</view>
 </template>
 
@@ -38,14 +41,15 @@
 export default {
 	data() {
 		return {
-			current: 0,
+			show: false,
+			current: 1,
 			tab: [{ name: '待接包' }, { name: '已接包' }, { name: '已完成' }],
 			list: [],
-			param: { pageNum: 1, pageSize: 10 },
+			param: { pageNum: 1, pageSize: 10, state: 0 },
 			loadMore: true
 		};
 	},
-	onLoad(e) {
+	onLoad() {
 		this.getData();
 	},
 	methods: {
@@ -93,6 +97,13 @@ export default {
 				}
 			});
 		},
+		//上传凭证
+		voucher(item) {
+			this.$refs.voucher.init(JSON.parse(JSON.stringify(item)));
+		},
+		success() {
+			this.refresh();
+		},
 		//刷新数据
 		refresh() {
 			this.loadMore = true;
@@ -165,6 +176,9 @@ export default {
 				float: right;
 			}
 		}
+		.cz {
+			float: right;
+		}
 	}
 }
 </style>

+ 3 - 3
app/pages/user/index.vue

@@ -34,7 +34,7 @@
 				<text class="icon arrow">&#xe62b;</text>
 			</view>
 		</view>
-		<button class="btn exit" @click="exit()" v-if="user.id">退出登录</button>
+		<!-- <button class="btn exit" @click="exit()" v-if="user.id">退出登录</button> -->
 	</view>
 </template>
 <script>
@@ -46,8 +46,8 @@ export default {
 		};
 	},
 	onShow() {
-		/* 		  this.user = {
-			token: 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjI2NTFjMmU4LTAxNzEtNDQwYS04YjA2LTcwOWI3N2ZhNGZiZCJ9.zb2gQaeHZApJkbo4LoSeZfnVVsJJ-QabY7FnsVn13Kf1KUgKeBQ82bwhzD-CqchI1dhUOQFoVh__zeJaJHFWGg'
+		 		 /* this.user = {
+			token: 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjllZjljY2QyLWM4ZmYtNGU2NS1hM2EwLWZlMzUzNWUxMzQ5MyJ9.ll0aR92AP8iZgQ4pVpQwfxcyIDKdPwkZA23uU_0ON_tAaxlepQqU04pbNPIx1vMKjADecBsvxB3vyfYDDATl3g'
 		};
 		uni.setStorageSync('user', this.user); */
 		if (this.hasLogin()) {

+ 1 - 1
app/pages/user/info.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view class="main">
-			<view class="form" v-if="item.isAuthentication === 1" style="margin-top: 10px">
+			<view class="form">
 				<view class="form_group">
 					<view class="lable">手机号</view>
 					<input type="text" v-model="item.phone" placeholder="请输入手机号" />

+ 6 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_PackagesController.java

@@ -4,6 +4,7 @@ import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.web.work.domain.Packages;
+import com.ruoyi.web.work.domain.dto.PackagesDto;
 import com.ruoyi.web.work.domain.vo.PackagesListVo;
 import com.ruoyi.web.work.service.IPackagesService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,4 +37,9 @@ public class Api_PackagesController extends BaseController {
     public AjaxResult add(@Validated @RequestBody Packages packages) throws ServerException {
         return packagesService.add(packages);
     }
+
+    @PostMapping("/voucher")
+    public AjaxResult voucher(@Validated @RequestBody PackagesDto dto) throws ServerException {
+        return packagesService.voucher(dto);
+    }
 }

+ 18 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/PackagesController.java

@@ -2,20 +2,21 @@ package com.ruoyi.web.work.controller;
 
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.PageUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.web.work.domain.Packages;
+import com.ruoyi.web.work.domain.dto.RejectDto;
 import com.ruoyi.web.work.service.IPackagesService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.rmi.ServerException;
 import java.util.List;
 
 /**
@@ -39,6 +40,19 @@ public class PackagesController extends BaseController {
         return getDataTable(list);
     }
 
+    @PreAuthorize("@ss.hasPermi('work:packages:list')")
+    @Log(title = "接包凭证审核通过", businessType = BusinessType.UPDATE)
+    @GetMapping("/success/{id}")
+    public AjaxResult success(@PathVariable("id") Long id) throws ServerException {
+        return packagesService.success(id);
+    }
+    @PreAuthorize("@ss.hasPermi('work:packages:list')")
+    @Log(title = "接包凭证审核驳回", businessType = BusinessType.UPDATE)
+    @PostMapping("reject")
+    public AjaxResult reject(@Validated @RequestBody RejectDto dto) throws ServerException {
+        return packagesService.reject(dto);
+    }
+
     @Log(title = "导出接包用户信息", businessType = BusinessType.EXPORT)
     @PreAuthorize("@ss.hasPermi('work:packages:list')")
     @PostMapping("/export")

+ 9 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Packages.java

@@ -39,6 +39,15 @@ public class Packages {
     @ApiModelProperty(value = "关联企业")
     private Long companyId;
 
+    @ApiModelProperty(value = "接包凭证")
+    private String voucher;
+
+    @ApiModelProperty(value = "凭证审核")
+    private Integer audit;
+
+    @ApiModelProperty(value = "驳回原因")
+    private String msg;
+
     @ApiModelProperty(value = "状态:0=已接包,1=已完成")
     private Integer state;
 

+ 16 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/dto/PackagesDto.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.work.domain.dto;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+public class PackagesDto {
+
+    @NotNull(message = "参数错误")
+    private Long id;
+
+    @NotBlank(message = "凭证不能为空")
+    private String voucher;
+}

+ 8 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/vo/PackagesListVo.java

@@ -20,6 +20,14 @@ public class PackagesListVo {
 
     private Long id;
 
+    @ApiModelProperty(value = "接包凭证")
+    private String voucher;
+
+    @ApiModelProperty(value = "凭证审核")
+    private Integer audit;
+
+    @ApiModelProperty(value = "驳回原因")
+    private String msg;
 
     @ApiModelProperty(value = "项目名称")
     private String projectName;
@@ -27,9 +35,6 @@ public class PackagesListVo {
     @ApiModelProperty(value = "企业名称")
     private String companyName;
 
-    @ApiModelProperty(value = "项目编号")
-    private String num;
-
     @ApiModelProperty(value = "项目内容")
     private String contents;
 

+ 8 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IPackagesService.java

@@ -3,6 +3,8 @@ package com.ruoyi.web.work.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.web.work.domain.Packages;
+import com.ruoyi.web.work.domain.dto.PackagesDto;
+import com.ruoyi.web.work.domain.dto.RejectDto;
 import com.ruoyi.web.work.domain.vo.PackagesListVo;
 
 import java.rmi.ServerException;
@@ -18,4 +20,10 @@ public interface IPackagesService extends IService<Packages>{
     List<PackagesListVo> selectPackagesList(Packages packages);
 
     AjaxResult add(Packages packages) throws ServerException;
+
+    AjaxResult voucher(PackagesDto dto) throws ServerException;
+
+    AjaxResult success(Long id) throws ServerException;
+
+    AjaxResult reject(RejectDto dto) throws ServerException;
 }

+ 57 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/PackagesServiceImpl.java

@@ -2,10 +2,13 @@ package com.ruoyi.web.work.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.web.work.api.util.AppUtil;
 import com.ruoyi.web.work.domain.Packages;
 import com.ruoyi.web.work.domain.Project;
 import com.ruoyi.web.work.domain.User;
+import com.ruoyi.web.work.domain.dto.PackagesDto;
+import com.ruoyi.web.work.domain.dto.RejectDto;
 import com.ruoyi.web.work.domain.vo.PackagesListVo;
 import com.ruoyi.web.work.mapper.PackagesMapper;
 import com.ruoyi.web.work.service.IPackagesService;
@@ -53,6 +56,7 @@ public class PackagesServiceImpl extends ServiceImpl<PackagesMapper, Packages> i
         if (project == null || project.getState() == 1) {
             return AjaxResult.error("项目不存在或被停用");
         }
+        packages.setAudit(0);
         packages.setState(0);
         packages.setUserId(AppUtil.getUser().getId());
         Packages check = packagesMapper.check(packages);
@@ -64,4 +68,57 @@ public class PackagesServiceImpl extends ServiceImpl<PackagesMapper, Packages> i
         }
         return AjaxResult.success();
     }
+
+    @Override
+    public AjaxResult voucher(PackagesDto dto) throws ServerException {
+        Packages packages = getById(dto.getId());
+        if (packages == null || !AppUtil.getUser().getId().equals(packages.getUserId())) {
+            return AjaxResult.error("包不存在或者非法操作");
+        }
+        if (packages.getAudit() == 2) {
+            return AjaxResult.error("你已上传凭证");
+        }
+        packages.setAudit(1);
+        packages.setVoucher(dto.getVoucher());
+        if (!updateById(packages)) {
+            throw new ServerException("更新凭证失败,请联系平台");
+        }
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult success(Long id) throws ServerException {
+        Packages packages = getById(id);
+        if (packages == null || !packages.getCompanyId().equals(SecurityUtils.getLoginUser().getUser().getCompanyId())) {
+            return AjaxResult.error("当前接包不存在或非法操作");
+        }
+        if (packages.getAudit() != 1) {
+            return AjaxResult.error("当前接包凭证不能被审核");
+        }
+        //凭证审核通过,接包完成
+        packages.setAudit(2);
+        packages.setState(1);
+        if (!updateById(packages)) {
+            throw new ServerException("更新凭证失败,请联系平台");
+        }
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult reject(RejectDto dto) throws ServerException {
+        Packages packages = getById(dto.getId());
+        if (packages == null || !packages.getCompanyId().equals(SecurityUtils.getLoginUser().getUser().getCompanyId())) {
+            return AjaxResult.error("当前接包不存在或非法操作");
+        }
+        if (packages.getAudit() == 2) {
+            return AjaxResult.error("当前接包凭证不能被审核");
+        }
+        packages.setMsg(dto.getMsg());
+        packages.setState(0);
+        packages.setAudit(3);
+        if (!updateById(packages)) {
+            throw new ServerException("更新凭证失败,请联系平台");
+        }
+        return AjaxResult.success();
+    }
 }

+ 14 - 1
ruoyi-admin/src/main/resources/mapper/work/PackagesMapper.xml

@@ -7,6 +7,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectList" resultType="com.ruoyi.web.work.domain.Packages">
         SELECT
         p.id,
+        p.audit,
+        p.state,
+        p.msg,
+        p.voucher,
         p.create_time,
         p.project_id,
         p.user_id,
@@ -34,7 +38,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectPackagesList" resultType="com.ruoyi.web.work.domain.vo.PackagesListVo">
         SELECT
-        p.*,
+        a.id,
+        a.audit,
+        a.state,
+        a.msg,
+        a.voucher,
+        a.create_time,
+        p.project_name,
+        p.balance_date,
+        p.start_date,
+        p.finish_date,
         c.company_name
         FROM
         tb_packages a