USER-20230908AJ\Administrator 1 rok temu
rodzic
commit
70c6ad2ab2

+ 78 - 21
page_task/task_details/module/record.vue

@@ -1,12 +1,12 @@
 <template>
 	<view class="text-color-12">
-		<view class="sys-background-fff m-20 p-20 r-20" v-for="(item,index) in 2" :key="index">
+		<view class="sys-background-fff m-20 p-20 r-20" v-for="(msg,index) in msgList" :key="index">
 			<view class="record-box row-justify-sb">
 				<view class="row-c">
 					<image class="wh-80" src="/static/img/index/index-avatar.png" mode="aspectFill"></image>
 					<view class="column m-l16">
-						<text class="size-26 sys-weight-600">章三</text>
-						<text class="size-24 text-color-999">总经理</text>
+						<text class="size-26 sys-weight-600">{{ msg.name }}</text>
+						<text class="size-24 text-color-999">{{ msg.position_name }}</text>
 					</view>
 				</view>
 				<view class="reply-box size-24">
@@ -18,29 +18,30 @@
 				<view class="empty-box"></view>
 				<view class="m-l16 size-26 flex">
 					<!-- 自己发送 -->
-					<text> 同意,利息2分。借款1个月,跟投两万。</text>
+					<text> {{ msg.msg }}</text>
 					<view class="image-box">
-						<image class="reply-img wh-60 m-t20 r-10 m-r20" src="/static/img/logo.png" mode="aspectFill"
-							v-for="(item,index) in 5" :key="index"></image>
+						<image class="reply-img wh-60 m-t20 r-10 m-r20" :src="msg_img.url" mode="aspectFill"
+							v-for="(msg_img,index) in msg.msg_img" :key="index"></image>
+<!--            <en-image :img="msg.msg_img" :width="130" height="130"></en-image>-->
 					</view>
 					<!-- 文件类型 -->
-					<view class="sys-from-background-color p-20 r-20 m-t20">
-						<view class="file-item row-c m-b20" v-for="(item,index) in 3" :key="index">
+					<view class="sys-from-background-color p-20 r-20 m-t20"  v-if="msg.file_list.length>0">
+						<view class="file-item row-c m-b20"  @click.stop="openFile(file)" v-for="(file,fileIndex) in msg.file_list" :key="index">
 							<image class="wh-45 m-r20" src="/static/img/task-details/icon-pdf.png" mode="aspectFill">
 							</image>
-							<text class="size-24 color-111827">资金证明资料.PDF</text>
+							<text class="size-24 color-111827">{{ file.name }}</text>
 						</view>
 					</view>
 					<!-- 1对1回复 -->
-					<view class="sys-from-background-color p-20 m-t20 r-20">
-						<view class="">
-							<text class="color-00A775">Administrator</text><text
-								class="m-lr10 text-color-666">回复</text><text class="color-00A775">隋成哲:</text>
+					<view class="sys-from-background-color p-20 m-t20 r-20"  v-if="msg.reply_list.length>0">
+						<view class="" v-for="replyItem in msg.reply_list">
+							<text class="color-00A775">{{ replyItem.name }}</text><text
+								class="m-lr10 text-color-666">回复</text><text class="color-00A775">{{ replyItem.ru_name }}:</text>
 							<view class="">
-								<view class="m-t16">可以</view>
-								<view class="image-box">
-									<image class="reply-img wh-60 m-t20 r-10 m-r20" src="/static/img/logo.png"
-										mode="aspectFill" v-for="(item,index) in 5" :key="index"></image>
+								<view class="m-t16">{{ replyItem.msg }}</view>
+								<view class="image-box" v-if="replyItem.msg_img.length>0">
+									<image class="reply-img wh-60 m-t20 r-10 m-r20" :src="r_img.url"
+										mode="aspectFill" v-for="(r_img,index) in replyItem.msg_img" :key="index"></image>
 								</view>
 							</view>
 						</view>
@@ -48,6 +49,7 @@
 				</view>
 			</view>
 		</view>
+    <en-blank v-if="msgList.length<=0"></en-blank>
 		<uni-popup background-color="#fff" ref="popup" type="bottom" borderRadius="10px 10px 0 0"
 			@touchmove.stop.prevent="moveHandle">
 			<view class="page-env-160">
@@ -64,18 +66,73 @@
 
 <script>
 	import SendChat from "./send_chat.vue"
+  import {getMsgList} from "@/api/task";
+  import EnImage from "@/components/en-utils/en-image/en-image.vue";
+  import tools from "@/service/tools";
+  import EnBlank from "@/components/en-utils/en-blank/en-blank.vue";
 
 	export default {
 		components: {
+      EnBlank,
+      EnImage,
 			SendChat
 		},
-		props: {
-
-		},
+    props: {
+      businessId:{
+        default:0
+      }
+    },
+    watch:{
+      'businessId':function () {
+        this.getMsgList()
+      }
+    },
 		data() {
-			return {}
+			return {
+        msgList: [],
+      }
 		},
 		methods: {
+      openFile(file) {
+        if (!file.url) {
+          tools.error('下载地址不存在')
+          return
+        }
+        tools.showLoading()
+        uni.downloadFile({
+          url: file.url, //仅为示例,并非真实的资源
+          success: (dRes) => {
+            tools.hideLoading()
+            if (dRes.statusCode === 200) {
+              tools.success('下载成功')
+              uni.saveFile({
+                tempFilePath: dRes.tempFilePath,
+                success: (res) => {
+                  uni.openDocument({
+                    filePath: res.savedFilePath,
+                    showMenu: true,
+                    success: function (res) {
+                    }
+                  });
+                }
+              });
+            }
+          }
+        });
+      },
+      getMsgList() {
+        if(this.businessId<=0){
+          return
+        }
+        getMsgList({
+          'business_id': this.businessId
+        }).then((res) => {
+          if (res.code === 1) {
+            this.msgList = res.data;
+            // this.setImgList()
+          }
+        })
+      },
 			moveHandle() {
 				return false
 			},

+ 41 - 53
page_task/task_details/module/steps.vue

@@ -1,23 +1,23 @@
 <template>
 	<view class="">
 		<view class="sys-background-fff m-20 p-20 r-20">
-			<view class="row-c" v-for="(item,index) in list" :key="index">
+			<view class="row-c" v-for="(item,index) in stageList" :key="index">
 				<view class="column-c" style="position: relative;top: 45rpx;">
 					<image class="wh-36"
-						:src="item.is_dot == 1? '/static/img/login/Checked1@3x.png':'/static/img/login/Checked2@3x.png'"
+						:src="item.is_execute !== 1? '/static/img/login/Checked1@3x.png':'/static/img/login/Checked2@3x.png'"
 						mode="aspectFill"></image>
-					<view class="steps-line" :style="{opacity:index == list.length - 1?0:1}"></view>
+					<view class="steps-line" :style="{opacity:index == stageList.length - 1?0:1}"></view>
 				</view>
 				<view class="sys-from-background-color steps-item p-20 r-20 column flex m-l20">
-					<text class="size-24 text-color-576">2024-12-20 12:45:00</text>
-					<view v-if="index == list.length - 1">
-						<text class="size-28 text-color-000 sys-weight-600">归档确认:</text>
-						<text class="size-28 text-color-576">-- -- -- --</text>
-					</view>
-					<view v-else>
-						<text class="size-28 text-color-666">外访:</text>
-						<text class="size-28 text-color-12 sys-weight-600">张三</text>
+					<text class="size-24 text-color-576">{{item.updated_at}}</text>
+					<view >
+						<text class="size-28 text-color-000 sys-weight-600">{{item.stage_name}}:</text>
+						<text class="size-28 text-color-576">{{item.name?item.name:'----'}}</text>
 					</view>
+<!--					<view v-else>-->
+<!--						<text class="size-28 text-color-666">外访:</text>-->
+<!--						<text class="size-28 text-color-12 sys-weight-600">张三</text>-->
+<!--					</view>-->
 				</view>
 			</view>
 		</view>
@@ -25,54 +25,42 @@
 </template>
 
 <script>
-	export default {
-		props: {
+	import {getStageList} from "@/api/task";
 
+  export default {
+		props: {
+      businessId:{
+        default:0
+      }
 		},
 		data() {
 			return {
-				list2: [{
-					title: '买家下单',
-					desc: '2018-11-11'
-				}, {
-					title: '卖家发货',
-					desc: '2018-11-12'
-				}, {
-					title: '买家签收',
-					desc: '2018-11-13'
-				}, {
-					title: '交易完成',
-					desc: '2018-11-14'
-				}],
-				list: [{
-					is_dot: 1,
-					time: '2024-12-20 12:45:00',
-					type: '签约',
-					name: '张三'
-				}, {
-					is_dot: 1,
-					time: '2024-12-20 12:45:00',
-					type: '签约',
-					name: '张三'
-				}, {
-					is_dot: 1,
-					time: '2024-12-20 12:45:00',
-					type: '签约',
-					name: '张三'
-				}, {
-					is_dot: 1,
-					time: '2024-12-20 12:45:00',
-					type: '签约',
-					name: '张三'
-				}, {
-					is_dot: 0,
-					time: '2024-12-20 12:45:00',
-					type: '签约',
-					name: '张三'
-				}]
+        stageList: []
 			}
 		},
-	}
+    watch:{
+      'businessId':function () {
+        this.getStageList()
+      }
+    },
+    mounted() {
+      // this.getStageList()
+    },
+    methods: {
+      getStageList() {
+        if(this.businessId<=0){
+          return false
+        }
+        getStageList({
+          'id': this.businessId
+        }).then((res) => {
+          if (res.code === 1) {
+            this.stageList = res.data
+          }
+        })
+      },
+    },
+  }
 </script>
 
 <style lang="scss" scoped>

+ 3 - 12
page_task/task_details/task_details.vue

@@ -61,8 +61,8 @@
 					</z-swiper>
 				</view>
 			</view>
-			<Record v-if="current === 3"></Record>
-			<Steps v-if="current === 4"></Steps>
+			<Record v-show="current === 3" :business-id="businessId"></Record>
+			<Steps v-show="current === 4" :business-id="businessId"></Steps>
 		</view>
 		<EnButton :text="'冲销'" v-if="current === 1"></EnButton>
 		<EnButton is_both :leftText="'交接'" :rightText="'操作'" v-if="current === 2" @onSubmit="onSubmit"></EnButton>
@@ -157,7 +157,6 @@
 			if (data.taskId !== undefined) {
 				this.businessId = data.taskId
 				this.getTaskDetail()
-				this.getStageList()
 			} else {
 				tools.leftClick()
 			}
@@ -183,15 +182,7 @@
 					tools.leftClick()
 				}
 			},
-			getStageList() {
-				getStageList({
-					'id': this.businessId
-				}).then((res) => {
-					if (res.code === 1) {
-						this.stageList = res.data
-					}
-				})
-			},
+
 			onChange(current) {
 				this.current = current
 			},

+ 1 - 1
pages.json

@@ -187,7 +187,7 @@
 			{
 				"name": "任务详情",
 				"path": "/page_task/task_details/task_details",
-				"query": "taskId=4273"
+				"query": "taskId=1793"
 			}
 
 		]