ming 3 anos atrás
pai
commit
6905d1e282

+ 11 - 2
common/common.scss

@@ -470,6 +470,17 @@ radio,checkbox {
 	
 	//现场档案详情
 	.archiveDetail {
+		image{
+			width:36rpx;
+			height:28rpx;
+		}
+		.form-item{
+			display:flex;
+			align-items: center;
+			// .title{
+			// 	width:70%!important
+			// }
+		}
 		.eleTime{
 			color:#999999;
 			margin-left: 12px;
@@ -521,7 +532,6 @@ radio,checkbox {
 	
 		.radioCameraflex {
 			display: flex;
-	
 			input {
 				border: none;
 				border-bottom: 1px solid #EDEDED;
@@ -530,7 +540,6 @@ radio,checkbox {
 				line-height: 50rpx;
 				width:30%;
 			}
-	
 			image {
 				width: 36rpx;
 				height: 28rpx;

+ 34 - 31
pages/messagePush/messagePush.vue

@@ -1,8 +1,6 @@
 <template>
 	<view class="padding-sm messagePush" style="padding-bottom:150rpx">
-
 		<form action="">
-
 			<checkbox-group class="block" @change="CheckboxChange" style="height: calc(100vh - 200rpx);
     overflow: scroll">
 				<view class="margin-top  ">
@@ -10,18 +8,13 @@
 						<checkbox class="blue" :class="item.checked==1?'checked':''"
 							:checked="item.checked==1?true:false" :value="item.value"></checkbox>
 						<view class="title">{{item.title}}</view>
-
-
 					</view>
 				</view>
 			</checkbox-group>
-
 			<view class="btn-area submitBottomBtn padding-lr-sm">
-				<button class="bg-blue round  margin-top" @click="$noMultipleClicks(btnSubmit())">提 交 </button>
+				<button class="bg-blue round  margin-top" @click="$noMultipleClicks(pushSubmit)">提 交 </button>
 			</view>
-
 		</form>
-
 	</view>
 </template>
 
@@ -206,10 +199,7 @@
 				var items = this.checkbox,
 					values = e.detail.value;
 				this.checkedValue = values;
-				// console.log(values)
 
-				// console.log('点击复选框时this.checkedValue')
-				// console.log(this.checkedValue)
 				for (var i = 0, lenI = items.length; i < lenI; ++i) {
 					items[i].checked = false;
 					for (var j = 0, lenJ = values.length; j < lenJ; ++j) {
@@ -221,7 +211,6 @@
 				}
 			},
 
-
 			// 回显数据请求
 			async getCheckList(params = {}) {
 				const res = await this.$myRequest({
@@ -229,10 +218,10 @@
 					data: params,
 					showLoading: true
 				})
+				console.log(res.data.data)
+				// console.log(JSON.parse(res.data.data))
 				this.getData = res.data.data[0];
 
-
-
 				// 遍历checkbox数组对象
 				for (let i = 0; i < this.checkbox.length; i++) {
 					//判断value是否存在于返回对象中.存在的话checked重新赋值
@@ -243,11 +232,11 @@
 				}
 			},
 
-
 			//提交
-			async btnSubmit() {
+			async pushSubmit() {
 
 				let mingParams = {};
+				
 				if (!this.flag) {
 					//不点击默认传参
 					var obgj = this.getData;
@@ -267,18 +256,41 @@
 					var arr = this.checkedValue;
 					console.log('自由选中复选框后传参arr')
 					console.log(arr)
-
-
 					arr.map((e) => {
 						mingParams[e] = true;
 					});
 					console.log('mingParams')
 					console.log(mingParams)
-
-
 				}
-
-
+				
+				console.log(this.getData)
+				console.log(mingParams)
+				
+				//验证是否有变动
+				let newValue=[];
+				let oldValue=[];
+				for(var key in mingParams){
+					newValue.push(key)
+				}
+				for(var key in this.getData){
+					oldValue.push(key)
+				}
+				if(oldValue.toString()==newValue.toString()){
+					uni.showToast({
+						title: "无修改!",
+						icon: "none"
+					});
+					return
+				}
+				
+				//验证是否为空
+				if(Object.keys(mingParams).length==0){
+					uni.showToast({
+						title: "请至少选择一条消息",
+						icon: "none"
+					});
+						return
+				}
 
 				let res = await this.PushSettings(mingParams);
 
@@ -297,8 +309,6 @@
 						});
 					}, 1000);
 				}
-				
-
 			},
 			PushSettings(params = {}) {
 				return this.$myRequest({
@@ -306,8 +316,6 @@
 					data: params
 				})
 			},
-
-
 		}
 	}
 </script>
@@ -318,14 +326,9 @@
 		display: inline-block;
 		text-align: left;
 		margin-bottom: 30rpx;
-
 		.title {
 			display: inline-block;
 			margin-left: 10rpx;
-			  //   text-align: left;
-				 // width: 80%;
-			
-			   
 		}
 	}
 </style>

+ 79 - 262
pages/siteArchive/archiveDetail/archiveDetail.vue

@@ -33,244 +33,60 @@
 			</view>
 			<view class="eleTime">
 				<image src="/static/noteIcon.png"></image>
-				<view>距离电试超期还有  <span>730</span>  天</view>
-				
-				</view>
-			
-			<view class="info-tit margin-left-xs">
-				<text class="cuIcon-titles margin-right-xs"></text>
-				现场问题 
-			</view>
-			<view class="form-item extraDis">
-				<view class="title">电缆孔洞:</view>
-				<radio-group name="gender">
-					<label class="margin-right-xl">
-						<radio disabled ="true" value="是" :checked='detailInfo.cable_hole == 1' /><text>是</text>
-					</label>
-					<label>
-						<radio disabled ="true" value="否" :checked='detailInfo.cable_hole == 0'/><text>否</text>
-					</label>
-				</radio-group>
-			</view>
-			<view class="form-item extraDis">
-				<view class="title">门窗、墙壁破损:</view>
-				<radio-group name="gender">
-					<label class="margin-right-xl">
-						<radio disabled ="true" value="是" :checked='detailInfo.damage == 1' /><text>是</text>
-					</label>
-					<label>
-						<radio disabled ="true" value="否" :checked='detailInfo.damage == 0'/><text>否</text>
-					</label>
-				</radio-group>
-			</view>
-			<view class="form-item extraDis">
-				<view class="title">屋顶墙壁渗漏水:</view>
-				<radio-group name="gender">
-					<label class="margin-right-xl">
-						<radio disabled ="true" value="是" :checked='detailInfo.water_leakage == 1' /><text>是</text>
-					</label>
-					<label>
-						<radio disabled ="true" value="否" :checked='detailInfo.water_leakage == 0'/><text>否</text>
-					</label>
-				</radio-group>
-			</view>
-			<view class="form-item extraDis">
-				<view class="title">灭火器配置不足:</view>
-				<radio-group name="gender">
-					<label class="margin-right-xl">
-						<radio disabled ="true" value="是" :checked='detailInfo.annihilator_insufficient_configuration == 1' /><text>是</text>
-					</label>
-					<label>
-						<radio disabled ="true" value="否" :checked='detailInfo.annihilator_insufficient_configuration == 0'/><text>否</text>
-					</label>
-				</radio-group>
-			</view>
-			<view class="form-item extraDis">
-				<view class="title">灭火器超期:</view>
-				<radio-group name="gender">
-					<label class="margin-right-xl">
-						<radio disabled ="true" value="是" :checked='detailInfo.annihilator_overdue == 1' /><text>是</text>
-					</label>
-					<label>
-						<radio disabled ="true" value="否" :checked='detailInfo.annihilator_overdue == 0'/><text>否</text>
-					</label>
-				</radio-group>
-			</view>
-			
-			<view class="info-tit margin-left-xs">
-				<text class="cuIcon-titles margin-right-xs"></text>
-				其他
-			</view>
-			<view class="form-item extraDis">
-				<view class="title">堆放杂物:</view>
-				<radio-group name="gender">
-					<label class="margin-right-xl">
-						<radio disabled ="true" value="是" :checked='detailInfo.pile_up_sundries == 1' /><text>是</text>
-					</label>
-					<label>
-						<radio disabled ="true" value="否" :checked='detailInfo.pile_up_sundries == 0'/><text>否</text>
-					</label>
-				</radio-group>
-			</view>
-			<view class="form-item extraDis">
-				<view class="title">积灰严重:</view>
-				<radio-group name="gender">
-					<label class="margin-right-xl">
-						<radio disabled ="true" value="是" :checked='detailInfo.serious_ash_deposition == 1' /><text>是</text>
-					</label>
-					<label>
-						<radio disabled ="true" value="否" :checked='detailInfo.serious_ash_deposition == 0'/><text>否</text>
-					</label>
-				</radio-group>
-			</view>
-			<view class="form-item extraDis">
-				<view class="title">配电房周围环境潮湿:</view>
-				<radio-group name="gender">
-					<label class="margin-right-xl">
-						<radio disabled ="true" value="是" :checked='detailInfo.around_environment_humid == 1' /><text>是</text>
-					</label>
-					<label>
-						<radio disabled ="true" value="否" :checked='detailInfo.around_environment_humid == 0'/><text>否</text>
-					</label>
-				</radio-group>
-			</view>
-			
-			<view class="form-item extraDis">
-				<view class="title">配电房周围环境潮湿:</view>
-				<radio-group name="gender">
-					<label class="margin-right-xl">
-						<radio disabled ="true" value="是" :checked='detailInfo.around_pile_up_sundries == 1' /><text>是</text>
-					</label>
-					<label>
-						<radio disabled ="true" value="否" :checked='detailInfo.around_pile_up_sundries == 0'/><text>否</text>
-					</label>
-				</radio-group>
-			</view>
-			
-			<view class="info-tit margin-left-xs">
-				<text class="cuIcon-titles margin-right-xs"></text>
-				电工
-			</view>
-			<view class="form-item extraDis">
-				<view class="title">无电工:</view>
-				<radio-group name="gender">
-					<label class="margin-right-xl">
-						<radio disabled ="true" value="是" :checked='detailInfo.no_electrician == 1' /><text>是</text>
-					</label>
-					<label>
-						<radio disabled ="true" value="否" :checked='detailInfo.no_electrician == 0'/><text>否</text>
-					</label>
-				</radio-group>
-			</view>
-			<view class="form-item extraDis">
-				<view class="title">电工人数配置不足:</view>
-				<radio-group name="gender">
-					<label class="margin-right-xl">
-						<radio disabled ="true" value="是" :checked='detailInfo.electrician_lack == 1' /><text>是</text>
-					</label>
-					<label>
-						<radio disabled ="true" value="否" :checked='detailInfo.electrician_lack == 0'/><text>否</text>
-					</label>
-				</radio-group>
-			</view>
-			<view class="form-item extraDis">
-				<view class="title">电工证超期:</view>
-				<radio-group name="gender">
-					<label class="margin-right-xl">
-						<radio disabled ="true" value="是" :checked='detailInfo.overdue_electrician_certificate == 1' /><text>是</text>
-					</label>
-					<label>
-						<radio disabled ="true" value="否" :checked='detailInfo.overdue_electrician_certificate == 0'/><text>否</text>
-					</label>
-				</radio-group>
-			</view>
-			
-			
-			<!-- 电试 -->
-			<view class="info-tit margin-left-xs">
-				<text class="cuIcon-titles margin-right-xs"></text>
-				电试
-			</view>
-			<view class="form-item extraDis">
-				<view class="title">电试超期:</view>
-				<radio-group name="gender">
-					<label class="margin-right-xl">
-						<radio disabled ="true" value="是" :checked='detailInfo.electric_test_overdue == 1' /><text>是</text>
-					</label>
-					<label>
-						<radio disabled ="true" value="否" :checked='detailInfo.electric_test_overdue == 0'/><text>否</text>
-					</label>
-				</radio-group>
-			</view>
-			
-			<!-- 设备 -->
-			<view class="info-tit margin-left-xs">
-				<text class="cuIcon-titles margin-right-xs"></text>
-				设备
-			</view>
-			<view class="form-item extraDis">
-				<view class="title">设备老旧(标明出厂或投运日期):</view>
-				<input type="text" disabled ="true" v-model="detailInfo.old_equipment" style="width:35%">
-			</view>
-			
-			<!-- 安全工器具 -->
-			<view class="info-tit margin-left-xs">
-				<text class="cuIcon-titles margin-right-xs"></text>
-				安全工器具
-			</view>
-			<view class="form-item extraDis">
-				<view class="title">配置不足(绝缘体):</view>
-				<radio-group name="gender">
-					<label class="margin-right-xl">
-						<radio disabled ="true" value="是" :checked='detailInfo.blanket_insufficient_configuration == 1' /><text>是</text>
-					</label>
-					<label>
-						<radio disabled ="true" value="否" :checked='detailInfo.blanket_insufficient_configuration == 0'/><text>否</text>
-					</label>
-				</radio-group>
+				<view>距离电试超期还有 <span>{{detailInfo.electric_test_overdue_bz}}</span> 天</view>
 			</view>
-			<view class="form-item extraDis">
-				<view class="title">接地线与存放位置编号:</view>
-				<radio-group name="gender">
-					<label class="margin-right-xl">
-						<radio disabled ="true" value="是" :checked='detailInfo.ground_wire == 1' /><text>是</text>
-					</label>
-					<label>
-						<radio disabled ="true" value="否" :checked='detailInfo.ground_wire == 0'/><text>否</text>
-					</label>
-				</radio-group>
-			</view>
-			
-			<!-- 安全工器具 -->
+
 			<view class="info-tit margin-left-xs">
 				<text class="cuIcon-titles margin-right-xs"></text>
-				模拟屏
-			</view>
-			<view class="form-item extraDis">
-				<view class="title">模拟屏:</view>
-				<radio-group name="gender">
-					<label class="margin-right-xl">
-						<radio disabled ="true" value="是" :checked='detailInfo.analog_screen == 1' /><text>是</text>
-					</label>
-					<label>
-						<radio disabled ="true" value="否" :checked='detailInfo.analog_screen == 0'/><text>否</text>
-					</label>
-				</radio-group>
-			</view>
-			<view class="form-item remark" >
-				<view class="title">备注:</view>
-				<!-- <input type="text" disabled="true" v-model="detailInfo.remarks"> -->
-				<textarea name="" id="" disabled="true" v-model="detailInfo.remarks"></textarea>
-			</view>
-			
-			
-			<view  v-if="this.control&&Object.keys(this.detailInfo).length!=0" class="btn-area submitBottomBtn padding-lr-sm  " style="position:static">
+				现场问题
+			</view>
+			<block v-for="(item,index) in  problem_one">
+				<view class="form-item  flex justify-between">
+					<view class="title" style="width:70%">{{item.name}}:</view>
+					<view class="margin-right flex align-center">
+						<label class="margin-right-xl">
+							<radio disabled="true" value="是" checked /><text>是</text>
+						</label>
+						<view @click="previewImage(item)">
+							<image :src="item.picture?item.picture:'/static/cameraIcon2.png'" mode="aspectFit"></image>
+						</view>
+
+					</view>
+				</view>
+			</block>
+			<block v-if="!this.control">
+				<view class="info-tit margin-left-xs">
+					<text class="cuIcon-titles margin-right-xs"></text>
+					其他
+				</view>
+
+				<view class="form-item  flex justify-between" v-for="(item,index) in problem_two">
+					<view class="title" style="width:70%">{{item.name}}:</view>
+					<view class="margin-right flex align-center">
+						<label class="" v-if="item.where==0">
+							<radio disabled="true" value="否" checked /><text>否</text>
+						</label>
+						<label class="" v-if="item.where==2">
+							<radio disabled="true" value="其他" checked /><text>其他</text>
+						</label>
+					</view>
+				</view>
+
+
+				<view class="form-item remark">
+					<view class="title">备注:</view>
+					<textarea name="" id="" disabled="true" v-model="detailInfo.remarks"></textarea>
+				</view>
+			</block>
+
+			<view v-if="this.control&&Object.keys(this.detailInfo).length!=0"
+				class="btn-area submitBottomBtn padding-lr-sm  " style="position:static">
 				<button class="bg-blue round  margin-top" @click="goArchiveEdit()">编 辑 </button>
 			</view>
+
 			<br>
 		</form>
 
-
 	</view>
 </template>
 
@@ -278,63 +94,64 @@
 	export default {
 		data() {
 			return {
-				detailInfo:{},
-				control:'',
-				id:''
+				detailInfo: {},
+				control: '',
+				id: '',
+				problem_one: [],
+				problem_two: [],
 			}
 		},
 		onLoad: function(option) {
-			console.log('option')
-			console.log(this.detailInfo)
-			if(option.siteId){
-				// alert(1)
-				this.getDataList({"site_id":option.siteId})
-			}else{
-				// alert(2)
-				this.getDataList({"id":option.id})
+			if (option.siteId) {
+				this.getDataList({
+					"site_id": option.siteId
+				})
+			} else {
+				this.getDataList({
+					"id": option.id
+				})
 			}
-			this.control=option.mark;
-			
-			this.id=option.id;
-			
+			this.control = option.mark;
+
+			this.id = option.id;
+
 		},
 		methods: {
-			goArchiveEdit(){
+			previewImage(item) {
+				// alert(1)
+				uni.previewImage({
+					urls: [item.picture ? item.picture : "/static/cameraIcon2.png"]
+				});
+
+			},
+			goArchiveEdit() {
 				uni.navigateTo({
-					url: '/pages/siteArchive/siteArchiveAdd/siteArchiveAdd?id='+this.id,
+					url: '/pages/siteArchive/siteArchiveAdd/siteArchiveAdd?id=' + this.id,
 				});
-				
 			},
 			//数据请求
 			async getDataList(params = {}) {
 				const res = await this.$myRequest({
-					url: 'Archives/getArchivesList',
+					url: 'Archives/getArchivesList1',
 					showLoading: true,
 					data: params
 				})
-				console.log('res.data.data')
-				console.log(res.data.data[0])
 				this.detailInfo = res.data.data[0];
-				if(!this.detailInfo){
+				this.problem_one = this.detailInfo.problem_one;
+				this.problem_two = this.detailInfo.problem_two
+				if (!this.detailInfo.account_number) {
 					uni.showToast({
 						title: "暂无档案信息!",
 						icon: "none"
 					});
 				}
 			},
-			
-	
-	
-
 		}
 	}
 </script>
 
-
-
-
-<style lang="scss" >
-	.form-item .title{
-		width:242rpx
+<style lang="scss">
+	.form-item .title {
+		width: 242rpx
 	}
 </style>

+ 39 - 5
pages/siteArchive/siteArchiveAdd/siteArchiveAdd.vue

@@ -8,7 +8,11 @@
 					<text class="necessary">*</text>
 					户号:
 				</view>
-				<input name="input" v-model="formMess.account_number" maxlength="20"></input>
+
+				<input name="input" v-model="formMess.account_number" maxlength="20" :disabled="isdisabledFn"></input>
+				<!-- <input v-if="this.id" name="input" v-model="formMess.account_number" maxlength="20" disabled></input>
+				<input v-else name="input" v-model="formMess.account_number" maxlength="20"></input>  -->
+
 			</view>
 			<view class="form-item">
 				<view class="title"><text class="necessary">*</text>流变变比:</view>
@@ -28,7 +32,7 @@
 			</view>
 			<view class="form-item">
 				<view class="title"><text class="necessary">*</text>站点名称:</view>
-				<select name="" id="" v-model="formMess.site_id" filterable clearable>
+				<select name="" id="" v-model="formMess.site_id" filterable clearable :disabled="isdisabledFn">
 					<option value="0">请选择</option>
 					<option :value="item.id" v-for="item in siteListData">{{ item.site_name}}</option>
 				</select>
@@ -357,7 +361,7 @@
 					"electric_test_overdue": "",
 
 					"cable_hole": "0",
-					 cable_hole_describe: '',
+					cable_hole_describe: '',
 
 					"damage": "0",
 					"damage_describe": "",
@@ -422,6 +426,17 @@
 				},
 			}
 		},
+		computed: {
+			isdisabledFn() {
+				if (this.id == null) {
+					return this.isdisabled = false;
+
+				} else {
+					return this.isdisabled = true;
+				}
+			}
+
+		},
 
 		onLoad: function(option) {
 			this.getDataList();
@@ -444,6 +459,12 @@
 
 		},
 		methods: {
+			// 正则表达式匹配年月日
+			isDate(d) {
+				return (
+						/^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29))$/)
+					.test(d);
+			},
 			// 相机拍照
 			goCamera(name, upimage) {
 				const that = this;
@@ -482,7 +503,6 @@
 					data: ming
 				})
 				this.formMess = res.data.data[0];
-
 			},
 
 			//线路名称下拉数据请求
@@ -517,7 +537,6 @@
 
 			//新增修改提交
 			async addSubmit() {
-				// alert(this.id)
 				//提交验证
 				if (!this.formMess.account_number.replace(/^\s*/g, '')) {
 					uni.showToast({
@@ -561,6 +580,21 @@
 					});
 					return
 				}
+				if (!this.formMess.electric_test_overdue) {
+					uni.showToast({
+						title: "请输入电试报告时间",
+						icon: "none"
+					});
+					return
+				}
+				if (this.isDate(this.formMess.electric_test_overdue) == false) {
+					uni.showToast({
+						title: "日期格式不正确,正确格式为:yyyy-mm-dd",
+						icon: "none"
+					});
+					return
+				}
+
 
 				let data = this.formMess;
 				// let url = 'Archives/addArchives';

BIN
static/cameraIcon2.png