Pārlūkot izejas kodu

危废回收开关功能

dedsudiyu 3 dienas atpakaļ
vecāks
revīzija
308156bfac

+ 8 - 0
pages_hazardousWasteRecycling/api/index.js

@@ -161,4 +161,12 @@ export const hwmsSupplierUserSignature = (data) => {
 		method: 'POST',
 		data: { ...data }
 	})
+};
+//查询报备配置
+export const hwmsRecycleConfigList = (data) => {
+	return apiResquest({
+		url: `/hwms/recycleConfig/list`,
+		method: 'POST',
+		data: { ...data }
+	})
 };

+ 25 - 0
pages_hazardousWasteRecycling/views/home/home.vue

@@ -34,23 +34,39 @@
 <script>
 	import {
 		hwmsAppRegisterApprovalMenuShow,
+		hwmsRecycleConfigList,
 	} from '@/pages_hazardousWasteRecycling/api/index.js'
 	export default {
 		data() {
 			return {
 				buttonTypeA:false,
 				buttonTypeB:false,
+				switchType:false,
 			}
 		},
 		onLoad(option) {
 		},
 		onShow() {
+			this.hwmsRecycleConfigList();
 			this.hwmsAppRegisterApprovalMenuShow();
 		},
 		mounted() {
 			
 		},
 		methods: {
+			async hwmsRecycleConfigList(){
+				let self = this;
+				const {
+					data
+				} = await hwmsRecycleConfigList()
+				if (data.code == 200) {
+					for(let i=0;i<data.data.length;i++){
+						if(data.data[i].configKey == 'HWMS_MASTER_SWITCH'){
+							self.$set(self,'switchType',data.data[i].configValue == 1?true:false);
+						}
+					}
+				}
+			},
 			async hwmsAppRegisterApprovalMenuShow(){
 				const {
 					data
@@ -73,6 +89,15 @@
 			},
 			goPage(type){
 				if(type == 1){
+					if(!this.switchType){
+						uni.showToast({
+							title: '危废回收已关闭 , 如有疑问请联系管理员',
+							icon: "none",
+							mask: true,
+							duration: 2000
+						});
+						return
+					}
 					uni.navigateTo({
 						url: "/pages_hazardousWasteRecycling/views/recyclingReportRecord/index",
 					});