Преглед изворни кода

Merge branch 'nwafu_1st_lhwrrs_v1.3_20260702(危险废物登记流程调优)' into SCHOOL-XiBeiNongLin

dedsudiyu пре 18 часа
родитељ
комит
8109ca4082

+ 6 - 0
pages.json

@@ -1136,6 +1136,12 @@
 					}
 				},
 				{
+					"path": "views/weighingRegistration/signatureListComponent",
+					"style": {
+						"navigationBarTitleText": "回收人员签名"
+					}
+				},
+				{
 					"path": "views/weighingRegistration/infoPage",
 					"style": {
 						"navigationBarTitleText": "登记单详情"

+ 16 - 0
pages_hazardousWasteRecycling/api/index.js

@@ -32,6 +32,14 @@ export const hwmsAppWasteOrderWasteDetail = (data) => {
 		data: { ...data }
 	})
 };
+//危废登记添加-前置留痕
+export const hwmsAppRegisterOrderPresign = (data) => {
+	return apiResquest({
+		url: `/hwms/app/registerOrder/presign`,
+		method: 'POST',
+		data: { ...data }
+	})
+};
 //危废登记添加
 export const hwmsAppRegisterOrderAdd = (data) => {
 	return apiResquest({
@@ -145,4 +153,12 @@ export const hwmsAppRegisterApprovalMenuShow = (data) => {
 		method: 'POST',
 		data: { ...data }
 	})
+};
+//获取回收人员签名列表
+export const hwmsSupplierUserSignature = (data) => {
+	return apiResquest({
+		url: `/hwms/supplierUser/signature`,
+		method: 'POST',
+		data: { ...data }
+	})
 };

+ 54 - 8
pages_hazardousWasteRecycling/views/recyclingReportRecord/index.vue

@@ -169,6 +169,7 @@
 			//新增
 			async hwmsAppWasteOrderAdd(obj){
 				let self = this;
+				obj.isUpdate = this.subId?true:false;
 				const {
 					data
 				} = await hwmsAppWasteOrderAdd(obj);
@@ -186,9 +187,12 @@
 			},
 			async hwmsAppWasteOrderFillWasteList(){
 				let self = this;
+				let obj = {
+					isUpdate : this.subId?true:false
+				};
 				const {
 					data
-				} = await hwmsAppWasteOrderFillWasteList();
+				} = await hwmsAppWasteOrderFillWasteList(obj);
 				if (data.code == 200) {
 					this.$set(this,'timeData',data.data.expectTime+'('+data.data.expectWeek+')');
 					this.$set(this.addForm,'expectTime',data.data.expectTime);
@@ -266,11 +270,30 @@
 			},
 			//选中类型
 			forChange(index,e){
-				this.$set(this.addForm.formData4[index],'forData1',this.addForm.formData4[index].forList[e.detail.value].id);
-				this.$set(this.addForm.formData4[index],'forData2',this.addForm.formData4[index].forList[e.detail.value].wasteName);
-				this.$set(this.addForm.formData4[index],'forData5',this.addForm.formData4[index].forList[e.detail.value].unit);
-				this.$set(this.addForm.formData4[index],'forData3',e.detail.value);
-				this.filtrateList();
+				let self = this;
+				if(self.addForm.formData4[index].forList[e.detail.value].remarkEnable){
+					uni.showModal({
+						title: '确认添加?',
+						content: self.addForm.formData4[index].forList[e.detail.value].remark,
+						cancelColor: "#999",
+						confirmColor: "#0183FA",
+						success: function(res) {
+							if(res.confirm){
+								self.$set(self.addForm.formData4[index],'forData1',self.addForm.formData4[index].forList[e.detail.value].id);
+								self.$set(self.addForm.formData4[index],'forData2',self.addForm.formData4[index].forList[e.detail.value].wasteName);
+								self.$set(self.addForm.formData4[index],'forData5',self.addForm.formData4[index].forList[e.detail.value].unit);
+								self.$set(self.addForm.formData4[index],'forData3',e.detail.value);
+								self.filtrateList();
+							}
+						}
+					});
+				}else{
+					self.$set(self.addForm.formData4[index],'forData1',self.addForm.formData4[index].forList[e.detail.value].id);
+					self.$set(self.addForm.formData4[index],'forData2',self.addForm.formData4[index].forList[e.detail.value].wasteName);
+					self.$set(self.addForm.formData4[index],'forData5',self.addForm.formData4[index].forList[e.detail.value].unit);
+					self.$set(self.addForm.formData4[index],'forData3',e.detail.value);
+					self.filtrateList();
+				}
 			},
 			//单位值加减
 			reductionAdd(type,index){
@@ -309,8 +332,31 @@
 			},
 			//删除类型
 			reductionItemButton(index){
-				this.addForm.formData4.splice(index,1);
-				this.filtrateList();
+				let self = this;
+				let num = 0;
+				for(let i=0;i<self.dialogOptionForList.length;i++){
+					if(self.dialogOptionForList[i].id == this.addForm.formData4[index].forData1){
+						if(self.dialogOptionForList[i].remarkEnable){
+							num++
+							uni.showModal({
+								title: '确认删除?',
+								content: self.dialogOptionForList[i].remark,
+								cancelColor: "#999",
+								confirmColor: "#0183FA",
+								success: function(res) {
+									if(res.confirm){
+										self.addForm.formData4.splice(index,1);
+										self.filtrateList();
+									}
+								}
+							});
+						}
+					}
+				}
+				if(num == 0){
+					self.addForm.formData4.splice(index,1);
+					self.filtrateList();
+				}
 			},
 			// 小数点后两位
 			handleInput(index,e){

+ 67 - 17
pages_hazardousWasteRecycling/views/weighingRegistration/addPage.vue

@@ -231,7 +231,7 @@
 										forData3:o,
 										forData4:data.data.wasteOrderDetailItemVos[i].quantity,
 										forData5:self.dialogOptionForList[o].unit,
-										forData6:0,
+										forData6:data.data.wasteOrderDetailItemVos[i].weight?data.data.wasteOrderDetailItemVos[i].weight:0,
 										forList:self.dialogOptionForList,
 									}
 									list.push(JSON.parse(JSON.stringify(obj)))
@@ -256,11 +256,36 @@
 			},
 			//选中类型
 			forChange(index,e){
-				this.$set(this.addForm.formData4[index],'forData1',this.addForm.formData4[index].forList[e.detail.value].id);
-				this.$set(this.addForm.formData4[index],'forData2',this.addForm.formData4[index].forList[e.detail.value].wasteName);
-				this.$set(this.addForm.formData4[index],'forData5',this.addForm.formData4[index].forList[e.detail.value].unit);
-				this.$set(this.addForm.formData4[index],'forData3',e.detail.value);
-				this.filtrateList();
+				console.log('e',e);
+				let self = this;
+				if(self.addForm.formData4[index].forList[e.detail.value].remarkEnable){
+					uni.showModal({
+						title: '确认添加?',
+						content: self.addForm.formData4[index].forList[e.detail.value].remark,
+						cancelColor: "#999",
+						confirmColor: "#0183FA",
+						success: function(res) {
+							if(res.confirm){
+								self.$set(self.addForm.formData4[index],'forData1',self.addForm.formData4[index].forList[e.detail.value].id);
+								self.$set(self.addForm.formData4[index],'forData2',self.addForm.formData4[index].forList[e.detail.value].wasteName);
+								self.$set(self.addForm.formData4[index],'forData5',self.addForm.formData4[index].forList[e.detail.value].unit);
+								self.$set(self.addForm.formData4[index],'forData3',e.detail.value);
+								self.filtrateList();
+							}
+						}
+					});
+				}else{
+					self.$set(self.addForm.formData4[index],'forData1',self.addForm.formData4[index].forList[e.detail.value].id);
+					self.$set(self.addForm.formData4[index],'forData2',self.addForm.formData4[index].forList[e.detail.value].wasteName);
+					self.$set(self.addForm.formData4[index],'forData5',self.addForm.formData4[index].forList[e.detail.value].unit);
+					self.$set(self.addForm.formData4[index],'forData3',e.detail.value);
+					self.filtrateList();
+				}
+				// this.$set(this.addForm.formData4[index],'forData1',this.addForm.formData4[index].forList[e.detail.value].id);
+				// this.$set(this.addForm.formData4[index],'forData2',this.addForm.formData4[index].forList[e.detail.value].wasteName);
+				// this.$set(this.addForm.formData4[index],'forData5',this.addForm.formData4[index].forList[e.detail.value].unit);
+				// this.$set(this.addForm.formData4[index],'forData3',e.detail.value);
+				// this.filtrateList();
 			},
 			//单位值加减
 			reductionAdd(type,index){
@@ -301,18 +326,43 @@
 			//删除类型
 			reductionItemButton(index){
 				let self = this;
-				uni.showModal({
-					// title: '确认要退出吗?',
-					content: '确认删除该类型?',
-					cancelColor: "#999",
-					confirmColor: "#0183FA",
-					success: function(res) {
-						if (res.confirm) {
-							self.addForm.formData4.splice(index,1);
-							self.filtrateList();
-						} else if (res.cancel) {}
+				let num = 0;
+				for(let i=0;i<self.dialogOptionForList.length;i++){
+					if(self.dialogOptionForList[i].id == this.addForm.formData4[index].forData1){
+						if(self.dialogOptionForList[i].remarkEnable){
+							num++
+							uni.showModal({
+								title: '确认删除?',
+								content: self.dialogOptionForList[i].remark,
+								cancelColor: "#999",
+								confirmColor: "#0183FA",
+								success: function(res) {
+									if(res.confirm){
+										self.addForm.formData4.splice(index,1);
+										self.filtrateList();
+									}
+								}
+							});
+						}else{
+							num++
+							uni.showModal({
+								content: '确认删除该类型?',
+								cancelColor: "#999",
+								confirmColor: "#0183FA",
+								success: function(res) {
+									if (res.confirm) {
+										self.addForm.formData4.splice(index,1);
+										self.filtrateList();
+									} else if (res.cancel) {}
+								}
+							});
+						}
 					}
-				});
+				}
+				if(num == 0){					
+					self.addForm.formData4.splice(index,1);
+					self.filtrateList();
+				}
 			},
 			
 			// 图片上传

+ 19 - 2
pages_hazardousWasteRecycling/views/weighingRegistration/confirmation.vue

@@ -25,7 +25,7 @@
 			</view>
 		</view>
 		<view class="flex-null-p"></view>
-		<view class="bottom-button-p" @click="confirmatinButton()">回收人员确认</view>
+		<view class="bottom-button-p" @click="hwmsAppRegisterOrderPresign()">回收人员确认</view>
 	</view>
 </template>
 
@@ -33,6 +33,9 @@
 	import {
 		config
 	} from '@/api/request/config.js'
+	import {
+		hwmsAppRegisterOrderPresign,
+	} from '@/pages_hazardousWasteRecycling/api/index.js'
 	export default {
 		data() {
 			return {
@@ -71,10 +74,24 @@
 				return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
 			},
 			confirmatinButton(){
+				// uni.navigateTo({
+				// 	url: "/pages_hazardousWasteRecycling/views/weighingRegistration/signatureComponent?data=" + encodeURIComponent(JSON.stringify(this.newData))
+				// });
 				uni.navigateTo({
-					url: "/pages_hazardousWasteRecycling/views/weighingRegistration/signatureComponent?data=" + encodeURIComponent(JSON.stringify(this.newData))
+					url: "/pages_hazardousWasteRecycling/views/weighingRegistration/signatureListComponent?data=" + encodeURIComponent(JSON.stringify(this.newData))
 				});
 			},
+			//前置留痕
+			async hwmsAppRegisterOrderPresign(){
+				const {
+					data
+				} = await hwmsAppRegisterOrderPresign(this.newData);
+				if (data.code == 200) {
+					uni.navigateTo({
+						url: "/pages_hazardousWasteRecycling/views/weighingRegistration/signatureListComponent?data=" + encodeURIComponent(JSON.stringify(this.newData))
+					});
+				}
+			},
 		},
 	}
 </script>

+ 249 - 0
pages_hazardousWasteRecycling/views/weighingRegistration/signatureListComponent.vue

@@ -0,0 +1,249 @@
+<template>
+	<view class="signatureComponent">
+		<view class="sub-picker-box">
+			<view class="mark-box">*</view>
+			<view class="title-box">回收人员</view>
+			<view class="picker-box">
+				<picker @change="userChange" style="width:100px;"
+				:value="addForm.signature" :range="optionList" :range-key="'realName'">
+					<view class="picker-p" :class="addForm.signature?'check-picker-p':''">{{addForm.signature?addForm.realName:'请选择回收人员'}}</view>
+				</picker>
+			</view>
+		</view>
+		<view v-if="!addForm.signature" class="text-position-box">请选择回收人员</view>
+		<img v-if="addForm.signature" class="text-position-img" :src="baseUrl+addForm.signature">
+		<view class="agreement-box">
+			<view class="agreement-min-box" @click="agreementButton">
+				<img class="agreement-img" v-if="!agreementType" :src="imagesUrl('commonality/icon_12.png')">
+				<img class="agreement-img" v-if="agreementType" :src="imagesUrl('commonality/icon_13.png')">
+				<view>* 本人为具备资质的危废回收人员,且已与报备人核实本次回收的危废种类与称重登记重量,签名即表示确认无误。</view>
+			</view>
+		</view>
+		<!-- 操作按钮 -->
+		<view class="button-group">
+			<view @click="saveSignature">完成</view>
+		</view>
+	</view>
+</template>
+<script>
+	import {
+		hwmsAppRegisterOrderAdd,
+		hwmsSupplierUserSignature,
+	} from '@/pages_hazardousWasteRecycling/api/index.js'
+	import {
+		config
+	} from '@/api/request/config.js'
+	export default {
+		data() {
+			return {
+				baseUrl:config.base_url,
+				newData:null,
+				//签名确认状态
+				agreementType:false,
+				optionList:[],//回收人员签名列表
+				addForm:{
+					signature:'',
+					realName:'',
+				}
+			};
+		},
+		onLoad(option) {
+			this.$set(this,'newData',JSON.parse(decodeURIComponent(option.data)));
+		},
+		mounted() {
+			this.hwmsSupplierUserSignature();
+		},
+		methods: {
+			//选中回收人员
+			userChange(e){
+				this.$set(this,'addForm',{
+					realName:this.optionList[e.detail.value].realName,
+					signature:this.optionList[e.detail.value].signature,
+				});
+				this.$set(this.newData,'collectorSign',this.optionList[e.detail.value].signature);
+			},
+			//获取回收人员签名列表
+			async hwmsSupplierUserSignature(){
+				const {
+					data
+				} = await hwmsSupplierUserSignature();
+				if (data.code == 200) {
+					this.$set(this,'optionList',data.data);
+				}
+			},
+			//条款确认
+			agreementButton(){
+				this.$set(this,'agreementType',!this.agreementType);
+			},
+			
+			saveSignature() {
+				let self = this;
+				if(!this.newData.collectorSign){
+					uni.showToast({
+						title: "请选择回收人员",
+						icon: "none",
+						mask: true,
+						duration: 2000
+					});
+					return
+				}
+				if(!this.agreementType){
+					uni.showToast({
+						title: "请确认相关条款",
+						icon: "none",
+						mask: true,
+						duration: 2000
+					});
+					return
+				}
+				uni.showModal({
+					// title: '确认要退出吗?',
+					content: '确认提交?',
+					cancelColor: "#999",
+					confirmColor: "#0183FA",
+					success: function(res) {
+						if (res.confirm) {
+							self.hwmsAppRegisterOrderAdd();
+						} else if (res.cancel) {
+							
+						}
+					}
+				});
+			},
+			//提交
+			async hwmsAppRegisterOrderAdd(){
+				const {
+					data
+				} = await hwmsAppRegisterOrderAdd(this.newData);
+				if (data.code == 200) {
+					uni.showToast({
+						title: '提交成功',
+						icon: "none",
+						mask: true,
+						duration: 2000
+					});
+					setTimeout(function() {
+						uni.navigateBack({
+							delta: 3
+						});
+					}, 2000);
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="stylus" scoped>
+	.signatureComponent {
+		height: 100%;
+		display flex;
+		flex: 1;
+		flex-direction column;
+		overflow: hidden;
+		position: relative;
+		background-color: #fff;
+		.text-position-box{
+			width:650rpx;
+			height:217rpx;
+			line-height:217rpx;
+			text-align: center;
+			font-size:26rpx;
+			color:#dedede;
+			margin:0 auto;
+			z-index:1;
+			margin-top:10rpx;
+			background-color: #fff;
+			border:1rpx solid #dedede;
+			border-radius:10rpx;
+		}
+		.text-position-img{
+			width:650rpx;
+			height:217rpx;
+			line-height:217rpx;
+			text-align: center;
+			font-size:26rpx;
+			color:#dedede;
+			margin:0 auto;
+			z-index:1;
+			margin-top:10rpx;
+			background-color: #fff;
+			border:1rpx solid #dedede;
+			border-radius:10rpx;
+		}
+		
+		.sub-picker-box{
+			display: flex;
+			font-size:30rpx;
+			height:80rpx;
+			width:300px;
+			margin:30rpx auto;
+			.mark-box{
+				color:red;
+				height:80rpx;
+				line-height:85rpx;
+				margin-bottom:20rpx;
+			}
+			.title-box{
+				margin:0 10rpx;
+				height:80rpx;
+				line-height:80rpx;
+			}
+			.picker-box{
+				height:80rpx;
+				flex:1;
+				border:1rpx solid #dedede;
+				border-radius:10rpx;
+				.picker-p{
+					padding:0 30rpx;
+					color:#999;
+					line-height:80rpx;
+					width:380rpx;
+					display:block;
+					overflow:hidden;
+					text-overflow:ellipsis;
+					white-space:nowrap;
+				}
+				.check-picker-p{
+					
+				}
+			}
+		}
+		.agreement-box{
+			flex:1;
+			margin:30rpx 60rpx;
+			.agreement-min-box{
+				display: flex;
+				margin-top:15rpx;
+				.agreement-img{
+					width:40rpx;
+					height:40rpx;
+					margin:0 10rpx 0 0;
+				}
+				view{
+					flex:1;
+					line-height:40rpx;
+					font-size:26rpx;
+				}
+			}
+		}
+		.button-group{
+			display: flex;
+			margin:0 auto;
+			margin-bottom:80rpx;
+			view{
+				font-size:24rpx;
+				width:200rpx;
+				height:60rpx;
+				line-height:60rpx;
+				text-align: center;
+				background-color: #fff
+				border-radius:6rpx;
+			}
+			view:nth-child(1){
+				border:1px solid #0183FA;
+				background-color: #0183FA;
+				color:#fff;
+			}
+		}
+	}
+</style>