Browse Source

消息部分代码提交

wangqiang 8 months ago
parent
commit
0fea3a1e28

+ 7 - 0
api/garbageClearance/overService.js

@@ -28,6 +28,13 @@ export default {
 			params: {officeId: officeId}
 			params: {officeId: officeId}
 		});
 		});
 	},
 	},
+	queryById: function (id) {
+		return request({
+			url: "/look/over/queryById",
+			method: "get",
+			params: { id: id },
+		});
+	},
 	getNotDisposeList: function (params) {
 	getNotDisposeList: function (params) {
 	return request({
 	return request({
 		url: "/look/over/getNotDisposeList",
 		url: "/look/over/getNotDisposeList",

+ 107 - 2
pages/apps/notification/notificationDetail.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-	<view>
+	<view v-if="!showFlag">
 		<u-cell-group :border="false">
 		<u-cell-group :border="false">
 			<u-cell :border="false">
 			<u-cell :border="false">
 				<u--text slot="title" :text="`标题:${notication.title}`"   ></u--text>
 				<u--text slot="title" :text="`标题:${notication.title}`"   ></u--text>
@@ -15,13 +15,87 @@
 			<u-parse :content="notication.content"></u-parse>
 			<u-parse :content="notication.content"></u-parse>
 		</view>
 		</view>
 	</view>
 	</view>
+	<view v-else-if="showFlag">
+		<!-- First Section: 巡视工单 to 联系方式 -->
+		<view class="form-section">
+			<u--form :model="inputForm" labelWidth="100px" class="u-form" labelPosition="left" :rules="rules" ref="inputForm" v-if="!nodeFlag">
+
+				<u-form-item label="巡视工单" prop="no">
+					<u--input v-model="inputForm.no" :disabled="true" placeholder="工单编号" clearable></u--input>
+				</u-form-item>
+
+				<u-form-item label="处理单位" borderBottom prop="processingUnit" :required="true" v-if="!disFlag">
+					<jp-picker v-model="inputForm.processingUnit" rangeKey="label" rangeValue="value" :range="processingUnits" @input="getUserInfoByOffId"></jp-picker>
+				</u-form-item>
+
+				<u-form-item label="处理单位" borderBottom prop="processingUnitName" :required="true" v-else-if="disFlag">
+					<u--input v-model="inputForm.processingUnitName" :disabled="true" placeholder="处理单位" clearable></u--input>
+				</u-form-item>
+
+				<u-form-item label="清运专员" prop="clearUserName">
+					<u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="清运专员" clearable></u--input>
+				</u-form-item>
+
+				<u-form-item label="联系方式" prop="clearUserMobile">
+					<u--input v-model="inputForm.clearUserMobile" :disabled="true" placeholder="联系方式" clearable></u--input>
+				</u-form-item>
+			</u--form>
+		</view>
+
+		<!-- Second Section: 上传图片 -->
+		<view class="form-section">
+			<text class="u-demo-block__title">现场照片</text>
+			<view class="u-page__upload-item">
+				<u-upload
+						:disabled="true"
+						:fileList="fileList1"
+						name="1"
+						multiple
+						:maxCount="10"
+				></u-upload>
+			</view>
+		</view>
+
+		<!-- Third Section: 备注 -->
+		<view class="form-section">
+			<u--form :model="inputForm" labelWidth="100px" class="u-form" labelPosition="left" :rules="rules" ref="inputForm" v-if="!nodeFlag">
+				<u-form-item label="备注" borderBottom prop="remarks">
+					<u--textarea placeholder='请填写备注' :maxlength="500" v-model="inputForm.remarks" :disabled="true"></u--textarea>
+				</u-form-item>
+			</u--form>
+		</view>
+	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+	import overService from '@/api/garbageClearance/overService'
 	import notifyService from "@/api/notify/notifyService";
 	import notifyService from "@/api/notify/notifyService";
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
+				disFlag: true,  // 启用动态获取处理单位则设置为false
+				processingUnits: [],
+				fileList1: [],
+				nodeFlag: false,
+				inputForm: {
+					no: '',
+					processingUnit: '',
+					processingUnitName: '',
+					clearUserId: '',
+					clearUserName: '',
+					clearUserMobile: '',
+					remarks: '',
+				},
+				rules: {
+					'processingUnit': [
+						{
+							required: true,
+							message: '处理单位不能为空',
+							trigger: ['blur', 'change']
+						}
+					],
+				},
+				showFlag: false,
 				notication: {
 				notication: {
 					title: '',
 					title: '',
 					createTime: '',
 					createTime: '',
@@ -32,7 +106,19 @@
 			}
 			}
 		},
 		},
 		onLoad (option) {
 		onLoad (option) {
-			notifyService.query({isSelf:true, id:option.id}).then((data)=>{
+			notifyService.query({isSelf:true, id:option.id}).then(async (data)=>{
+
+				if (data.lookOverId) {
+					this.showFlag = true;
+				}
+				// 获取巡视工单信息
+				await overService.queryById(data.lookOverId).then((data) => {
+					data.no = 'XS-J' + data.no;
+					console.log('data', data)
+					this.fileList1 = data.fileList1
+					console.log('this.fileList1', this.fileList1)
+					this.inputForm = this.recover(this.inputForm, data)
+				})
 				this.notication = data
 				this.notication = data
 			});
 			});
 		}
 		}
@@ -40,5 +126,24 @@
 </script>
 </script>
 
 
 <style>
 <style>
+	.form-section {
+		padding: 10px 15px;
+		margin-bottom: 10px;
+		background-color: #ffffff;
+		border-radius: 5px;
+		box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
+	}
 
 
+	.u-page__upload-item {
+		margin-top: 10px;
+	}
+
+	.button-container {
+		margin-top: 20px;
+		text-align: center;
+	}
+
+	.cu-form-group .title {
+		min-width: 100px;
+	}
 </style>
 </style>

+ 2 - 2
pages/edt/PatrolWorkOrderForm.vue

@@ -108,11 +108,11 @@
             let data = await overService.getMaxNo();
             let data = await overService.getMaxNo();
             if (data) {
             if (data) {
                 let newNo = parseInt(data, 10) + 1;
                 let newNo = parseInt(data, 10) + 1;
-                this.inputForm.no = 'XJ-J' + newNo;
+                this.inputForm.no = 'XS-J' + newNo;
             } else {
             } else {
                 // 获取当前年份
                 // 获取当前年份
                 let nowY = new Date().getFullYear();
                 let nowY = new Date().getFullYear();
-                this.inputForm.no = 'XJ-J' + nowY + '0001';
+                this.inputForm.no = 'XS-J' + nowY + '0001';
             }
             }
 
 
             // 如果要使用动态获取处理单位则设置为true
             // 如果要使用动态获取处理单位则设置为true