From 2ffea51205b7eb94cf3fb7221aede7ff66669fc1 Mon Sep 17 00:00:00 2001
From: wjt <1797368093@qq.com>
Date: 星期一, 29 七月 2024 15:59:04 +0800
Subject: [PATCH] 新需求修改

---
 qiye/record/details.vue |  390 +++++++++++++++++++++++++++++++------------------------
 1 files changed, 218 insertions(+), 172 deletions(-)

diff --git a/qiye/record/details.vue b/qiye/record/details.vue
index d1a0d4d..ba6803b 100644
--- a/qiye/record/details.vue
+++ b/qiye/record/details.vue
@@ -7,10 +7,11 @@
 		</u-navbar>
 		<view class="donw-box"></view>
 		<view class="page-main">
-			<view class="title">
-				<template v-if="msg.isEva==0">宸叉墽娉曞緟璇勪环</template>
-				<template v-if="msg.isEva==1">宸茶瘎浠�</template>
-				<template v-if="msg.orderStatus==2">寰呮墽娉�</template>
+			<view class="title">
+				鎵ф硶璇︽儏
+			<!-- 	<template v-if="msg.isEva==0">鏈瘎浠�</template>
+				<template v-if="msg.isEva==1">宸茶瘎浠�</template>
+				<template v-if="msg.orderStatus==2">寰呮墽娉�</template> -->
 			</view>
 			<view class="wbox">
 				<view class="item">
@@ -26,7 +27,7 @@
 						鎵ф硶浜�
 					</view>
 					<view class="v">
-						{{msg.executeUser}}
+						{{msg.executeUser || msg.applyUser}}
 					</view>
 				</view>
 				<view class="item">
@@ -34,17 +35,17 @@
 						鎵ф硶閮ㄩ棬
 					</view>
 					<view class="v">
-						{{msg.executeDeptName}}
+						{{msg.executeDeptName || msg.applyDeptName}}
 					</view>
 				</view>
-				<view class="item">
+				<!-- <view class="item">
 					<view class="k">
 						浼佷笟
 					</view>
 					<view class="v">
 						{{msg.companyName}}
 					</view>
-				</view>
+				</view> -->
 			</view>
 			<view style="height: 20rpx;"></view>
 			<view class="wbox">
@@ -58,11 +59,16 @@
 				</view>
 				<view class="item">
 					<view class="k">
-						鎵ф硶杩囩▼
+						鎵ф硶鍐呭
+					</view>
+					<view class="v" v-if="!img.length">
+						{{ msg.enforceContent}}
 					</view>
 				</view>
-				<view class="imgbox">
-					<img v-for="(item,index) in img" :key="index" :src="item" class="more" alt="" @click="imgclick(item)" />
+				<view class="imgbox"  v-if="img.length">
+					<template >
+						<img v-for="(item,index) in img" :key="index" :src="item" class="more" alt="" @click="imgclick(item)" />
+					</template>
 					
 					<!-- <img src="/static/i01.png" class="more" @click="imgclick('/static/i01.png')" alt="" />
 					<img src="/static/i02.png" class="more" alt="" />
@@ -74,7 +80,7 @@
 						鎵ф硶缁撴灉
 					</view>
 					<view class="v" style="color: #EB4746;">
-						{{msg.regionReason}}
+						{{msg.regionReason || '--'}}
 					</view>
 				</view>
 				<view class="item">
@@ -82,7 +88,7 @@
 						鎵ф硶鏃堕棿
 					</view>
 					<view class="v">
-						{{msg.executeTime}}
+						{{msg.inTime || msg.planTime}}
 					</view>
 				</view>
 			</view>
@@ -90,70 +96,70 @@
 			<view class="wbox2" v-if="msg.isEva==1">
 				<view class="t">
 					鎵ф硶璇勪环
-				</view>
-				<template v-for="(item,index) in qlist">
-					<view class="sbox" v-if="item.questionType==2">
-						<view class="t2">
-							{{item.questionName}}
-						</view>
-						<view class="xbox">
-							<view>
-								<img src="/static/qiye/xing1.png" alt="" />
-								<view>
-									寰堢碂绯�
-								</view>
-							</view>
-							<view>
-								<img v-if="item.getScore>=2" src="/static/qiye/xing1.png" alt="" />
-								<img v-else src="/static/qiye/xing2.png" alt="" />
-								<view :class="item.getScore==2?'hei':''">
-									涓嶆弧鎰�
-								</view>
-							</view>
-							<view>
-								<img v-if="item.getScore>=3" src="/static/qiye/xing1.png" alt="" />
-								<img v-else src="/static/qiye/xing2.png" alt="" />
-								<view :class="item.getScore==3?'hei':''">
-									涓�鑸埇
-								</view>
-							</view>
-							<view>
-								<img v-if="item.getScore>=4" src="/static/qiye/xing1.png" alt="" />
-								<img v-else src="/static/qiye/xing2.png" alt="" />
-								<view :class="item.getScore==4?'hei':''">
-									婊℃剰
-								</view>
-							</view>
-							<view>
-								<img v-if="item.getScore>=5" src="/static/qiye/xing1.png" alt="" />
-								<img v-else src="/static/qiye/xing2.png" alt="" />
-								<view :class="item.getScore==5?'hei':''">
-									闈炲父婊℃剰
-								</view>
-							</view>
-						</view>
-						<view class="line"></view>
-					</view>
-					<view class="sbox" v-if="item.questionType==1">
-						<view class="t2">
-							{{item.questionName}}
-						</view>
-						<u-radio-group v-model="item.remark">
-							<u-radio v-for="(aa, ii) in item.answerList" :key="ii" :name="aa.answerId" 
-							:disabled="item.remark!=aa.answerId">
-								{{aa.answerName}}
-							</u-radio>
-						</u-radio-group>
-						<!-- <u-radio-group v-model="value">
-							<u-radio name="orange">閫変腑</u-radio>
-							<u-radio name="1" :disabled="true">鏈�変腑</u-radio>
-						</u-radio-group> -->
-						<view class="line"></view>
-					</view>
+				</view>
+				<template v-for="(item,index) in qlist">
+					<view class="sbox" v-if="item.questionType==2">
+						<view class="t2">
+							{{item.questionName}}
+						</view>
+						<view class="xbox">
+							<view>
+								<img src="/static/qiye/xing1.png" alt="" />
+								<view>
+									寰堢碂绯�
+								</view>
+							</view>
+							<view>
+								<img v-if="item.getScore>=2" src="/static/qiye/xing1.png" alt="" />
+								<img v-else src="/static/qiye/xing2.png" alt="" />
+								<view :class="item.getScore==2?'hei':''">
+									涓嶆弧鎰�
+								</view>
+							</view>
+							<view>
+								<img v-if="item.getScore>=3" src="/static/qiye/xing1.png" alt="" />
+								<img v-else src="/static/qiye/xing2.png" alt="" />
+								<view :class="item.getScore==3?'hei':''">
+									涓�鑸埇
+								</view>
+							</view>
+							<view>
+								<img v-if="item.getScore>=4" src="/static/qiye/xing1.png" alt="" />
+								<img v-else src="/static/qiye/xing2.png" alt="" />
+								<view :class="item.getScore==4?'hei':''">
+									婊℃剰
+								</view>
+							</view>
+							<view>
+								<img v-if="item.getScore>=5" src="/static/qiye/xing1.png" alt="" />
+								<img v-else src="/static/qiye/xing2.png" alt="" />
+								<view :class="item.getScore==5?'hei':''">
+									闈炲父婊℃剰
+								</view>
+							</view>
+						</view>
+						<view class="line"></view>
+					</view>
+					<view class="sbox" v-if="item.questionType==1">
+						<view class="t2">
+							{{item.questionName}}
+						</view>
+						<u-radio-group v-model="item.remark">
+							<u-radio v-for="(aa, ii) in item.answerList" :key="ii" :name="aa.answerId" 
+							:disabled="item.remark!=aa.answerId">
+								{{aa.answerName}}
+							</u-radio>
+						</u-radio-group>
+						<!-- <u-radio-group v-model="value">
+							<u-radio name="orange">閫変腑</u-radio>
+							<u-radio name="1" :disabled="true">鏈�変腑</u-radio>
+						</u-radio-group> -->
+						<view class="line"></view>
+					</view>
 				</template>
 				
 				
-				<view class="sbox">
+				<view class="sbox" v-if="msg.evaluateVo.questionRemark">
 					<view class="t2">
 						瀵规垜浠殑璇勪环
 					</view>
@@ -163,20 +169,34 @@
 				</view>
 			</view>
 		</view>
-		<view class="bottom">
-			<view class="one" v-if="msg.isEva==1">
+		<view class="bottom" v-if=" msg.orderStatus== 5">
+			<view class="one" v-if="msg.isComplaint != 1 && msg.isEva == 1">
 				<view class="b1" @click="open()">
 					鎶曡瘔
 				</view>
 			</view>
-			<view class="two" v-if="msg.isEva==0">
-				<view class="b2" @click="open()">
+			<view class="two" v-if="msg.isComplaint != 1 && msg.isEva != 1">
+				<view class="b2" @click="open()" >
 					鎶曡瘔
 				</view>
 				<view class="b3" @click="pingjia()">
 					鎴戣璇勪环
 				</view>
 			</view>
+			<view class="one" v-if="msg.isComplaint == 1 && msg.isEva != 1">
+				<view class="b1" @click="pingjia()">
+					鎴戣璇勪环
+				</view>
+			</view>
+		</view>
+		<view class="bottom" v-if=" msg.orderStatus == 4">
+			<view class="one" >
+				<view class="b1" style="background-color: #1171E0;color: white;" @click="enterOrder()">
+					纭
+				</view>
+			</view>
+			
+			
 		</view>
 		<u-popup :show="show" @close="close" mode="bottom" round="10" closeable>
 			<view class="page-box">
@@ -188,18 +208,18 @@
 					<view class="font">
 						鎶曡瘔涓婚
 					</view>
-					<view>
-						<u-radio-group v-model="complaintType">
-													<u-radio v-for="(aa, ii) in list" :key="ii" :name="aa.dictCode">
-														{{aa.dictLabel}}
-													</u-radio>
+					<view>
+						<u-radio-group v-model="complaintType">
+													<u-radio v-for="(aa, ii) in list" :key="ii" :name="aa.dictCode">
+														{{aa.dictLabel}}
+													</u-radio>
 												</u-radio-group>
 					</view>
 					<view class="font">
 						鎶曡瘔鍐呭
 					</view>
 					<view class="margin-top">
-						<u-textarea v-model="complaintReason" placeholder="璇疯緭鍏�..."></u-textarea>
+						<u-textarea :cursorSpacing="70" v-model="complaintReason" placeholder="璇疯緭鍏�..."></u-textarea>
 					</view>
 				</view>
 				<view class="down">
@@ -210,63 +230,86 @@
 	</view>
 </template>
 
-<script>
-	import { order } from '@/api/index.js'
-	import { getDicts } from '@/api/data.js'
-	import { config } from '@/common/config'
-	import { orderComplaint } from '@/api/qiye.js'
+<script>
+	import { order } from '@/api/index.js'
+	import { getDicts } from '@/api/data.js'
+	import { config } from '@/common/config'
+	import { orderComplaint, confirmOrderId } from '@/api/qiye.js'
 	export default {
 		data() {
-			return {
-				complaintType:'',
-				complaintReason:'',
-				id:'',
-				msg:{},
-				type:'',
-				img:[],
+			return {
+				complaintType:'',
+				complaintReason:'',
+				id:'',
+				msg:{},
+				type:'',
+				img:[],
 				baseUrl: config.baseUrl,
 				xing: 5,
 				value: 'orange',
 				//type: 2,
 				show: false,
 				list: [
-				],
+				],
 				qlist:[]
 			}
-		},
-		onLoad(options) {
-			this.id = options.id
-			//this.getdata(options.id)
-			getDicts('complaint_type').then(val => {
-				this.list = val.data.data
-				console.log(this.list)
-			    // const value = val.data.data.find(item => item.dictCode == this.msg.enforceType)
-			    // this.type = value.dictLabel
-			})
-		},
-		onShow(options) {
-			this.getdata()
 		},
-		methods: {
-			getdata(){
-				order(this.id).then(val => {
-					this.msg = val.data.data
-					let arr = this.msg.regionImgs.split(",");
-					for(let i = 0;i<arr.length;i++){
-						this.img.push(this.baseUrl+arr[i])
-					}
-					this.qlist = this.msg.evaluateVo.questionList
-					for(let i = 0;i<this.qlist.length;i++){
-						if(this.qlist[i].questionType==1&&this.qlist[i].remark){
-							this.qlist[i].remark = Number(this.qlist[i].remark)
-						}
-					}
-					console.log(this.img)
-					getDicts('enforce_type').then(val => {
-					    const value = val.data.data.find(item => item.dictCode == this.msg.enforceType)
-					    this.type = value.dictLabel
-					})
-				})
+		onLoad(options) {
+			this.id = options.id
+			//this.getdata(options.id)
+			getDicts('complaint_type').then(val => {
+				this.list = val.data.data
+				console.log(this.list)
+			    // const value = val.data.data.find(item => item.dictCode == this.msg.enforceType)
+			    // this.type = value.dictLabel
+			})
+			// this.getdata()
+		},
+		onShow(options) {
+			this.getdata()
+		},
+		methods: {
+			enterOrder() {
+				uni.showModal({
+					title: '鎻愮ず',
+					content: '纭璇ヨ鍗曪紵',
+					success: val => {
+						if(val.confirm) {
+							confirmOrderId({orderId: this.msg.orderId}).then(val => {
+								if(val.data.code == 200) {
+									uni.showToast({
+										title: '纭鎴愬姛',
+										icon: 'none'
+									})
+									this.getdata()
+								}
+							})
+						}
+					}
+					
+				})
+			
+			},
+			getdata(){
+				order(this.id).then(val => {
+					
+					this.msg = val.data.data
+					getDicts('enforce_type').then(val => {
+					    const value = val.data.data.find(item => item.dictCode == this.msg.enforceType)
+					    this.type = value.dictLabel
+					})
+					let arr = this.msg.regionImgs.split(",");
+					for(let i = 0;i<arr.length;i++){
+						this.img.push(this.baseUrl+arr[i])
+					}
+					this.qlist = this.msg.evaluateVo.questionList
+					for(let i = 0;i<this.qlist.length;i++){
+						if(this.qlist[i].questionType==1&&this.qlist[i].remark){
+							this.qlist[i].remark = Number(this.qlist[i].remark)
+						}
+					}
+				
+				})
 			},
 			daxing(a) {
 				this.xing = a
@@ -275,11 +318,11 @@
 				uni.previewImage({
 					urls: [url]
 				})
-			},
-			pingjia(){
-				uni.navigateTo({
-					url: `/qiye/record/evaluate?id=${this.msg.orderId}`
-				})
+			},
+			pingjia(){
+				uni.navigateTo({
+					url: `/qiye/record/evaluate?id=${this.msg.orderId}`
+				})
 			},
 			open() {
 				this.show = true
@@ -289,34 +332,34 @@
 				this.$emit('cancel')
 			},
 			entery() {
-				this.$emit('entery')
-				if(this.complaintType==''){
-					uni.showToast({
-						title: '璇烽�夋嫨鎶曡瘔涓婚',
-						icon: 'none'
-					})
-					return
-				}
-				if(this.complaintReason==''){
-					uni.showToast({
-						title: '璇疯緭鍏ユ姇璇夊唴瀹�',
-						icon: 'none'
-					})
-					return
-				}
-				let data = {
-					orderId:Number(this.id),
-					complaintType:this.complaintType,
-					complaintReason:this.complaintReason
-				}
-				console.log(data)
-				//return;
-				orderComplaint(data).then(val => {
-					uni.showToast({
-						title: '鎻愪氦鎴愬姛',
-						icon: 'none'
-					})
-					this.show = false
+				this.$emit('entery')
+				if(this.complaintType==''){
+					uni.showToast({
+						title: '璇烽�夋嫨鎶曡瘔涓婚',
+						icon: 'none'
+					})
+					return
+				}
+				if(this.complaintReason==''){
+					uni.showToast({
+						title: '璇疯緭鍏ユ姇璇夊唴瀹�',
+						icon: 'none'
+					})
+					return
+				}
+				let data = {
+					orderId:Number(this.id),
+					complaintType:this.complaintType,
+					complaintReason:this.complaintReason
+				}
+				console.log(data)
+				//return;
+				orderComplaint(data).then(val => {
+					uni.showToast({
+						title: '鎻愪氦鎴愬姛',
+						icon: 'none'
+					})
+					this.show = false
 				})
 			},
 
@@ -372,16 +415,19 @@
 		}
 
 		.imgbox {
-			display: flex;
-			flex-wrap: wrap;
-			justify-content: space-between;
+			display: grid;
+			grid-template-columns: 1fr 1fr 1fr;
+			grid-gap: 10rpx;
+			// display: flex;
+			// flex-wrap: wrap;
+			// justify-content: space-between;
 			border-radius: 10rpx;
 
 			img {
 				width: 198rpx;
 				height: 198rpx;
 				margin-bottom: 20rpx;
-
+				border-radius: 10rpx;
 			}
 		}
 	}
@@ -451,7 +497,7 @@
 		margin-top: 20rpx;
 		flex-wrap: wrap;
 		.u-radio {
-			margin-right: 20rpx;
+			margin-right: 20rpx;
 			margin-bottom: 20rpx;
 		}
 	}
@@ -514,10 +560,10 @@
 
 	.page-box {
 		padding: 24rpx 0;
-		.font{
-			color: #4a4e60;
-			font-size: 32rpx;
-			margin-top: 20rpx;
+		.font{
+			color: #4a4e60;
+			font-size: 32rpx;
+			margin-top: 20rpx;
 		}
 		.title1 {
 			font-size: 36rpx;

--
Gitblit v1.9.1